mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-05-03 20:49: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
|
@ -21,9 +21,19 @@ public class GuildOption<T> : IGuildOption
|
|||
|
||||
public string Name { get; }
|
||||
|
||||
protected virtual string Value(JsonNode settings)
|
||||
{
|
||||
return Get(settings).ToString() ?? throw new InvalidOperationException();
|
||||
}
|
||||
|
||||
public virtual string Display(JsonNode settings)
|
||||
{
|
||||
return Markdown.InlineCode(Get(settings).ToString() ?? throw new InvalidOperationException());
|
||||
return Markdown.InlineCode(Value(settings));
|
||||
}
|
||||
|
||||
public virtual Result<bool> ValueEquals(JsonNode settings, string value)
|
||||
{
|
||||
return Value(settings).Equals(value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue