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

Show an error when entering the same value from the settings (#326)

Closes #324
This commit is contained in:
Macintxsh 2024-07-31 12:13:29 +03:00 committed by GitHub
parent 07e8784d2e
commit d6d2660fb0
Signed by: GitHub
GPG key ID: B5690EEEBB952194
9 changed files with 67 additions and 4 deletions

View file

@ -1,6 +1,5 @@
using System.Globalization;
using System.Text.Json.Nodes;
using Remora.Discord.Extensions.Formatting;
using Remora.Results;
namespace TeamOctolings.Octobot.Data.Options;
@ -16,9 +15,9 @@ public sealed class LanguageOption : GuildOption<CultureInfo>
public LanguageOption(string name, string defaultValue) : base(name, CultureInfoCache[defaultValue]) { }
public override string Display(JsonNode settings)
protected override string Value(JsonNode settings)
{
return Markdown.InlineCode(settings[Name]?.GetValue<string>() ?? "en");
return settings[Name]?.GetValue<string>() ?? "en";
}
/// <inheritdoc />