using System.Text.Json.Nodes;
using Remora.Results;
namespace TeamOctolings.Octobot.Data.Options;
///
public sealed class PunishmentOption : GuildOption
{
private static readonly List AllowedValues =
[
"ban", "kick", "mute", "off", "disable", "disabled"
];
public PunishmentOption(string name, string defaultValue) : base(name, defaultValue) { }
///
public override Result Set(JsonNode settings, string from)
{
return AllowedValues.Contains(from.ToLowerInvariant())
? base.Set(settings, from.ToLowerInvariant())
: new ArgumentInvalidError(nameof(from), Messages.InvalidWarnPunishment);
}
}