feat: invite management commands

This commit is contained in:
sam 2024-10-14 00:26:17 +02:00
parent 32732d74d0
commit 5a2bd7388c
6 changed files with 310 additions and 13 deletions

View file

@ -2,6 +2,8 @@ using OneOf;
using Remora.Discord.API.Abstractions.Objects;
using Remora.Discord.API.Abstractions.Rest;
using Remora.Discord.API.Objects;
using Remora.Discord.Commands.Feedback.Messages;
using Remora.Discord.Commands.Feedback.Services;
using Remora.Rest.Core;
using Remora.Results;
@ -28,4 +30,24 @@ public static class DiscordRestExtensions
>(data)
)
);
public static async Task<Result<IMessage>> ReplyAsync(
this IFeedbackService feedbackService,
Optional<string> content = default,
IEnumerable<IEmbed>? embeds = null,
bool isEphemeral = false
) =>
await feedbackService.SendContextualAsync(
content,
embeds != null
? new Optional<IReadOnlyList<IEmbed>>(embeds.ToList())
: new Optional<IReadOnlyList<IEmbed>>(),
options: new FeedbackMessageOptions(
MessageFlags: isEphemeral ? MessageFlags.Ephemeral : 0,
AllowedMentions: new AllowedMentions(
Parse: new List<MentionType>(),
MentionRepliedUser: true
)
)
);
}