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:
parent
07e8784d2e
commit
d6d2660fb0
9 changed files with 67 additions and 4 deletions
|
@ -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 />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue