1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-05-01 19:49:55 +03:00

FeedbackServiceExtensions: Add FeedbackMessageOptions support (#219)

Required for #218
This commit is contained in:
Macintxsh 2023-12-17 18:44:18 +03:00 committed by GitHub
parent b284ac28d5
commit 9a23e1d533
Signed by: GitHub
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 40 additions and 40 deletions

View file

@ -1,4 +1,5 @@
using Remora.Discord.API.Objects;
using Remora.Discord.Commands.Feedback.Messages;
using Remora.Discord.Commands.Feedback.Services;
using Remora.Results;
@ -7,13 +8,14 @@ namespace Octobot.Extensions;
public static class FeedbackServiceExtensions
{
public static async Task<Result> SendContextualEmbedResultAsync(
this IFeedbackService feedback, Result<Embed> embedResult, CancellationToken ct = default)
this IFeedbackService feedback, Result<Embed> embedResult,
FeedbackMessageOptions? options = null, CancellationToken ct = default)
{
if (!embedResult.IsDefined(out var embed))
{
return Result.FromError(embedResult);
}
return (Result)await feedback.SendContextualEmbedAsync(embed, ct: ct);
return (Result)await feedback.SendContextualEmbedAsync(embed, options, ct);
}
}