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

Add ChannelApiExtensions (#217)

This PR adds an extension method to make it easier to pass Result<Embed> to CreateMessageAsync

---------

Co-authored-by: Octol1ttle <l1ttleofficial@outlook.com>
This commit is contained in:
Macintxsh 2023-12-17 19:47:52 +03:00 committed by GitHub
parent 9a23e1d533
commit 541e18fff0
Signed by: GitHub
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 64 additions and 102 deletions

View file

@ -140,12 +140,7 @@ public class KickCommandGroup : CommandGroup
.WithColour(ColorsList.Red)
.Build();
if (!dmEmbed.IsDefined(out var dmBuilt))
{
return Result.FromError(dmEmbed);
}
await _channelApi.CreateMessageAsync(dmChannel.ID, embeds: new[] { dmBuilt }, ct: ct);
await _channelApi.CreateMessageWithEmbedResultAsync(dmChannel.ID, embedResult: dmEmbed, ct: ct);
}
var kickResult = await _guildApi.RemoveGuildMemberAsync(