1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-05-03 12:39:54 +03:00

List supported languages if an invalid one is provided (#9)

Co-authored-by: l1ttleO <l1ttleofficial@outlook.com>
This commit is contained in:
Macintxsh 2022-12-09 14:39:21 +03:00 committed by GitHub
parent fc00558dce
commit 938f918445
Signed by: GitHub
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 934 additions and 736 deletions

View file

@ -111,7 +111,11 @@ public sealed class SettingsCommand : ICommand {
}
if (selectedSetting is "Lang" && !Utils.CultureInfoCache.ContainsKey(value)) {
cmd.Reply(Messages.LanguageNotSupported, ReplyEmojis.Error);
var langNotSupported = Boyfriend.StringBuilder.Append($"{Messages.LanguageNotSupported} ");
foreach (var lang in Utils.CultureInfoCache) langNotSupported.Append($"`{lang.Key}`, ");
langNotSupported.Remove(langNotSupported.Length - 2, 2);
cmd.Reply(langNotSupported.ToString(), ReplyEmojis.Error);
langNotSupported.Clear();
return Task.CompletedTask;
}