mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-01-31 09:09:00 +03:00
20 lines
570 B
C#
20 lines
570 B
C#
|
using Remora.Discord.API.Objects;
|
|||
|
using Remora.Discord.Commands.Feedback.Services;
|
|||
|
using Remora.Results;
|
|||
|
|
|||
|
namespace Octobot.Extensions;
|
|||
|
|
|||
|
public static class FeedbackServiceExtensions
|
|||
|
{
|
|||
|
public static async Task<Result> SendContextualEmbedResultAsync(
|
|||
|
this FeedbackService feedback, Result<Embed> embedResult, CancellationToken ct = default)
|
|||
|
{
|
|||
|
if (!embedResult.IsDefined(out var embed))
|
|||
|
{
|
|||
|
return Result.FromError(embedResult);
|
|||
|
}
|
|||
|
|
|||
|
return (Result)await feedback.SendContextualEmbedAsync(embed, ct: ct);
|
|||
|
}
|
|||
|
}
|