feat: invite management commands
This commit is contained in:
parent
32732d74d0
commit
5a2bd7388c
6 changed files with 310 additions and 13 deletions
|
|
@ -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
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue