1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-04-30 11:09:54 +03:00

this commit is illegal

This commit is contained in:
Macintxsh 2024-07-20 20:28:05 +05:00
parent 07e8784d2e
commit e0161037bb
Signed by: mctaylors
GPG key ID: 4EEF4F949A266EE2
8 changed files with 63 additions and 3 deletions

View file

@ -12,6 +12,18 @@ public sealed class BoolOption : GuildOption<bool>
return Get(settings) ? Messages.Yes : Messages.No;
}
public override Result ValueEquals(JsonNode settings, string value, out bool equals)
{
if (!TryParseBool(value, out var boolean))
{
equals = false;
return new ArgumentInvalidError(nameof(value), Messages.InvalidSettingValue);
}
equals = Value(settings).Equals(boolean.ToString());
return Result.Success;
}
public override Result Set(JsonNode settings, string from)
{
if (!TryParseBool(from, out var value))