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 language from 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 battery.
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 before anything 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 blocklist uses — masks a short list of unambiguous slurs even if the model renders one. Second, the bot mirrors your server’s native Discord AutoMod keyword rules onto 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.
Translate a message
Separate from auto-translate, and with nothing to set up: reply to any message with ktl and kesarAI replies with a translation into English. It works whether or not auto-translate is on, and in DMs.
- Add a few words after it to steer the translation:
ktl to frenchtranslates into French, andktl literalasks for a literal version. - It reads the message’s text (forwarded messages and embeds too), the text in up to three images, and voice notes and videos, which are transcribed first.
- The reply names the languages, like arabic -> english, then gives the translation in quotes and up to three short notes for what a translation can’t carry, such as a dialect, an idiom or a pun.
- A message that is already in the target language is rewritten in plain words instead, which helps with slang.
- Swearing and insults are translated as they are. Only hard slurs and rape terms are masked, and a translation flagged as crude, sexual, hateful or threatening is noted in the server’s translate log.
In a server ktl needs the AI tier, and each use takes a little of your AI battery. A translation too long for one message arrives as a translation.txt file.
ktr is the same idea for speech: reply to a voice message, an audio file or a video with ktr and kesarAI replies with a transcript of what was said, as a file when it is long. It takes files up to 20 MB and also uses a little battery.
