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:
parent
9a23e1d533
commit
541e18fff0
10 changed files with 64 additions and 102 deletions
|
@ -158,12 +158,7 @@ public class BanCommandGroup : 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 banResult = await _guildApi.CreateGuildBanAsync(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue