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:
parent
b284ac28d5
commit
9a23e1d533
11 changed files with 40 additions and 40 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue