Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added backend automation API routes under
`/api/guilds/:guildId/automation/*` for manifest CRUD, run execution, status,
and cutover operations
- Added automation-adjacent management endpoints:
`GET /api/guilds/:guildId/channels`,
`GET /api/guilds/:guildId/automod/templates`,
`POST /api/guilds/:guildId/automod/templates/:templateId/apply`, and
`POST /api/guilds/:guildId/automation/presets/criativaria/apply`

- Added `docs/BOT_COMMAND_ROADMAP_BENCHMARKS.md` with a benchmark-driven Lucky
command roadmap (Dyno, Rythm, Loritta, MEE6, Carl-bot references), prioritized
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,8 @@ Lucky now supports declarative server automation for guild operations:
- Safe auto-apply for non-destructive changes
- Protected operations (deletes/permission tightening) require explicit opt-in
- Native Discord onboarding mapping (`fetchOnboarding`/`editOnboarding`) is first-class
- Companion management APIs cover channel options, automod templates, and the
Criativaria preset bootstrap under `/api/guilds/:guildId/*`
- Cutover role cleanup targets only external bots explicitly flagged with
`retireOnCutover: true` in parity manifest data
- Automation API precondition failures (`no manifest`, `capture required`,
Expand Down
93 changes: 93 additions & 0 deletions packages/backend/src/constants/automodTemplates.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
type TemplateSettings = {
enabled: boolean
spamEnabled: boolean
spamThreshold: number
spamTimeWindow: number
capsEnabled: boolean
capsThreshold: number
linksEnabled: boolean
allowedDomains: string[]
invitesEnabled: boolean
wordsEnabled: boolean
bannedWords: string[]
}

export interface AutoModTemplate {
id: string
name: string
description: string
settings: TemplateSettings
}

const MALICIOUS_DOMAIN_BLOCKLIST = [
'grabify.link',
'iplogger.org',
'2no.co',
'yip.su',
'blasze.com',
'whereis.5july.net',
'shorturl.at',
'bitly.is',
'freediscordnitro.com',
'discrod-gift.com',
'steamcomunnity.com',
'stearncommunnity.com',
]

const BANNED_WORDS_BALANCED = [
'kys',
'kill yourself',
'suicide bait',
'nigger',
'faggot',
'retard',
'ddos',
'phishing',
'token grabber',
'nitro free',
'free nitro',
'scam link',
'golpe',
'phish',
'roubar conta',
'token steal',
'vaza dados',
'cp link',
'malware',
'keylogger',
]

export const AUTO_MOD_TEMPLATES: AutoModTemplate[] = [
{
id: 'balanced',
name: 'Balanced Shield',
description:
'Balanced baseline for PT-BR + EN communities with common scam and abuse protection.',
settings: {
enabled: true,
spamEnabled: true,
spamThreshold: 6,
spamTimeWindow: 8,
capsEnabled: true,
capsThreshold: 75,
linksEnabled: true,
allowedDomains: [
'discord.com',
'discord.gg',
'youtube.com',
'youtu.be',
'spotify.com',
'open.spotify.com',
'twitch.tv',
'github.com',
],
invitesEnabled: true,
wordsEnabled: true,
bannedWords: [...BANNED_WORDS_BALANCED, ...MALICIOUS_DOMAIN_BLOCKLIST],
},
},
]

export function getAutoModTemplate(templateId: string): AutoModTemplate | null {
return AUTO_MOD_TEMPLATES.find((template) => template.id === templateId) ?? null
}
65 changes: 65 additions & 0 deletions packages/backend/src/constants/guildAutomationPresets.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import type { GuildAutomationManifestDocument } from '@lucky/shared/services'

export function buildCriativariaPreset(
guildId: string,
): GuildAutomationManifestDocument {
return {
version: 1,
guild: {
id: guildId,
name: 'Criativaria',
},
moderation: {
automod: {
enabled: true,
spamEnabled: true,
linksEnabled: true,
invitesEnabled: true,
wordsEnabled: true,
},
moderationSettings: {
warnThreshold: 3,
muteDurationMinutes: 30,
},
},
automessages: {
welcome: {
enabled: true,
message:
'Bem-vindo(a) ao servidor! Leia as regras e aproveite a comunidade.',
},
leave: {
enabled: true,
message: 'Ate logo! Esperamos voce de volta em breve.',
},
},
parity: {
shadowMode: false,
externalBots: [
{ id: '155149108183695360', name: 'Dyno' },
{ id: '204255221017214977', name: 'MEE6' },
{ id: '270904126974590976', name: 'Carl-bot' },
],
checklist: [
{
key: 'commands-migrated',
label: 'Comandos principais migrados para Lucky',
done: false,
},
{
key: 'automod-parity',
label: 'Regras de automod alinhadas com o setup legado',
done: false,
},
{
key: 'welcome-flow',
label: 'Fluxo de boas-vindas e onboarding validado',
done: false,
},
],
cutoverReady: false,
},
source: 'manual',
capturedAt: new Date().toISOString(),
}
}
Loading
Loading