1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-05-04 21:16:29 +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

@ -202,6 +202,29 @@ public sealed class SettingsCommandGroup : CommandGroup
IGuildOption option, string value, GuildData data, Snowflake channelId, IUser executor, IUser bot,
CancellationToken ct = default)
{
Console.WriteLine(option.Value(data.Settings));
var equalsResult = option.ValueEquals(data.Settings, value, out var equals);
if (!equalsResult.IsSuccess)
{
var failedEmbed = new EmbedBuilder().WithSmallTitle(Messages.SettingNotChanged, bot)
.WithDescription(equalsResult.Error.Message)
.WithColour(ColorsList.Red)
.Build();
return await _feedback.SendContextualEmbedResultAsync(failedEmbed, ct: ct);
}
if (equals)
{
var failedEmbed = new EmbedBuilder().WithSmallTitle(Messages.SettingNotChanged, bot)
.WithDescription(Messages.SettingValueEquals)
.WithColour(ColorsList.Red)
.Build();
return await _feedback.SendContextualEmbedResultAsync(failedEmbed, ct: ct);
}
var setResult = option.Set(data.Settings, value);
if (!setResult.IsSuccess)
{