mirror of
https://github.com/TeamOctolings/Octobot.git
synced 2025-01-31 09:09:00 +03:00
Octol1ttle
309d900067
This feature will improve the debugging experience for developers by providing the information about *where exactly* a result has failed --------- Signed-off-by: Octol1ttle <l1ttleofficial@outlook.com>
21 lines
683 B
C#
21 lines
683 B
C#
using Remora.Discord.API.Objects;
|
|
using Remora.Discord.Commands.Feedback.Messages;
|
|
using Remora.Discord.Commands.Feedback.Services;
|
|
using Remora.Results;
|
|
|
|
namespace Octobot.Extensions;
|
|
|
|
public static class FeedbackServiceExtensions
|
|
{
|
|
public static async Task<Result> SendContextualEmbedResultAsync(
|
|
this IFeedbackService feedback, Result<Embed> embedResult,
|
|
FeedbackMessageOptions? options = null, CancellationToken ct = default)
|
|
{
|
|
if (!embedResult.IsDefined(out var embed))
|
|
{
|
|
return ResultExtensions.FromError(embedResult);
|
|
}
|
|
|
|
return (Result)await feedback.SendContextualEmbedAsync(embed, options, ct);
|
|
}
|
|
}
|