2023-10-12 18:37:25 +03:00
|
|
|
|
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(
|
2023-11-04 21:28:22 +03:00
|
|
|
|
this IFeedbackService feedback, Result<Embed> embedResult, CancellationToken ct = default)
|
2023-10-12 18:37:25 +03:00
|
|
|
|
{
|
|
|
|
|
if (!embedResult.IsDefined(out var embed))
|
|
|
|
|
{
|
|
|
|
|
return Result.FromError(embedResult);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (Result)await feedback.SendContextualEmbedAsync(embed, ct: ct);
|
|
|
|
|
}
|
|
|
|
|
}
|