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:
parent
07e8784d2e
commit
e0161037bb
8 changed files with 63 additions and 3 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue