Repository navigation
Bot settings: allow leaving the language unset - #297
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
enstored 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
botConfig, so leaving it out unsets it.components/bot/bot-config-values.ts, so it can be tested without a DOM.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."en"as fallback in both places) 3 of 4 tests fail.pnpm --filter @msk-forms/webtypecheck, eslint and prettier on the changed files.