// auto-translate
Auto-translate
Pick a main language for your server and kesarAI keeps the chat in it. Messages written in any other language are deleted and instantly reposted as a translation — under the author’s own name and avatar, via a webhook — so the conversation stays readable without anyone being silenced.
Overview
Auto-translate is off by default. You enable it and choose the main languagefrom sixteen options — English (US/UK), Spanish, French, German, Italian, Portuguese (Brazil), Dutch, Polish, Turkish, Russian, Arabic, Hindi, Japanese, Korean, and Chinese (Simplified).
The repost is a 1:1 replacement, not a paraphrase. The translation preserves meaning, tone, slang, profanity level, emoji, markdown, line breaks, and Discord mention/emoji tokens byte-for-byte — it never summarises, softens, or answers the message. Because the webhook mimics the author’s display name and avatar, the channel reads as if they had written it in the main language themselves.
Messages already in the main language are never touched. A cheap heuristic pre-filter screens out the overwhelming majority of main-language chat before any AI is involved, and the model itself has two more outs: a “same language” sentinel, and an echo guard that aborts if the “translation” comes back essentially identical to the input. Auto-translate costs members nothing from their AI quota.
How it works
The pipeline is ordered so a message can never be lost:
- The heuristic pre-filter flags the message as a translation candidate. The original stays visible throughout.
- The AI translates it. Errors, “same language” verdicts, echoes, and over-length results all abort silently with the original untouched.
- The channel webhook is resolved beforeanything is deleted — if the bot is missing Manage Webhooks, it stops here.
- The original is deleted, then the translation is reposted as the author. If the webhook fails at the last moment, the bot falls back to a plain
Name: translationmessage rather than losing the content.
A few things are deliberately out of scope: messages with attachments or stickers are skipped entirely (a content-only repost would lose the media), edited messages aren’t rescanned, and other bots and webhooks are ignored. Per-user and per-server rate limits keep a multilingual flood from turning into an AI-call flood — messages past the limit are simply left untranslated.
Replying to a translation
A webhook post isn’t a real user, so replying to it wouldn’t notify anyone. kesarAI fixes that by routing replies back to the original author:
- Reply with the literal word
pingand the bot publicly pings the original author under your reply — the quick “hey, look at this” path. - Reply with anything else and the author gets a DM: who replied, in which server, with a jump link straight to the reply.
Replying to your own translated message does nothing, and DM notifications are rate-limited per replier–author pair so a back-and-forth thread doesn’t spam anyone’s inbox. The repost–author mapping survives bot restarts and is kept for about a week.
Bypasses & exclusions
- Bypass roles— members holding any listed role are never translated.
- Bypass permission— members with the configured Discord permission are exempt: Manage Messages by default, switchable to Administrator. Administrators always bypass either way, since Discord grants them every permission.
- Excluded channels— messages in listed channels are left alone; threads inherit their parent channel’s exclusion.
Safety filters
The translated text passes through two filters before it’s reposted. First, a hard-slur censor — the same leetspeak/look-alike normalisation machinery the /say blocklistuses — masks a short list of unambiguous slurs even if the model renders one. Second, the bot mirrors your server’s native Discord AutoMod keyword rulesonto the repost: because webhook messages skip Discord’s own AutoMod, kesarAI fetches your enabled keyword rules (refreshed every few minutes), applies them itself, and replaces matches with [CENSORED]. The mirror needs Manage Guild and degrades silently without it.
Blocking non-main-language /say
An optional sub-toggle (on by default once auto-translate is enabled) extends the language policy to /say: if the relayed text isn’t in the main language, the command is refused with an error instead of posted. The check fails open — if the AI is unreachable, /say goes through rather than being blocked by an outage.
Configuration & permissions
Everything lives on the dashboard at /dashboard/translate: the enable switch, main language, bypass roles, bypass permission, excluded channels, and the /say gate. For the feature to work the bot needs Manage Messages (to delete the original) and Manage Webhooks(to repost as the author) in the channels you want covered — missing webhook access is logged once and that channel is skipped, never half-processed. Manage Guild is optional and only powers the AutoMod keyword mirroring.