Skip to content

Bot settings: allow leaving the language unset - #297

Merged
Musiker15 merged 2 commits into
mainfrom
fix/bot-guild-locale
Oct 29, 2026
Merged

Musiker15 merged 2 commits into
mainfrom
fix/bot-guild-locale

Conversation

@Musiker15

Copy link
Copy Markdown
Member

Problem

The hint under the bot language says "Leave unset to send applicant DMs in each applicant's own Discord language", but the select only offered the seven languages and showed English when nothing was stored. Every save wrote locale: "en", so after a guild saved its bot settings once (for a channel or a role), its applicants only got English DMs.

In production 7 guilds have en stored right now. Some of them may have picked it on purpose, so I left the data alone. They can switch to "Not set" themselves.

Fix

  • The select starts with "Not set: English, DMs in each applicant's language". An unset locale is shown as that option instead of English.
  • The locale is only sent when one is chosen. The route replaces the whole botConfig, so leaving it out unsets it.
  • Building the PATCH body moved from the component into components/bot/bot-config-values.ts, so it can be tested without a DOM.
  • New option label in all seven languages.

Tests

  • bot-config-values.test.ts: unset locale shown as unset, left out of the body, a chosen locale is saved, a stored config round-trips without gaining a locale.
  • Counter-check: with the old behaviour ("en" as fallback in both places) 3 of 4 tests fail.
  • pnpm --filter @msk-forms/web typecheck, eslint and prettier on the changed files.

The bot settings hint says to leave the language unset so applicant DMs go
out in each applicant's own Discord language, but the select had no unset
option and every save wrote locale "en". Once a guild saved its bot
settings for any reason, its applicants only ever got English DMs.

The select now starts with "Not set" and the locale is only sent when one
is chosen; the route replaces the whole config, so leaving it out unsets
it. Building the PATCH body moves into bot-config-values.ts so it can be
tested without a DOM.
@Musiker15
Musiker15 merged commit a1edcb7 into main Oct 29, 2026
4 checks passed
@Musiker15
Musiker15 deleted the fix/bot-guild-locale branch October 29, 2026 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant