feat(bot): add support for Discord message context commands (#513)

This commit is contained in:
Iris System 2023-05-15 15:17:34 +00:00 committed by GitHub
parent 13c055dc0f
commit 83af1f04a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 515 additions and 30 deletions

View file

@ -90,6 +90,11 @@ public class DiscordApiClient
_client.Delete($"/channels/{channelId}/messages/{messageId}/reactions/{EncodeEmoji(emoji)}",
("DeleteAllReactionsForEmoji", channelId));
public Task<ApplicationCommand[]?> ReplaceGlobalApplicationCommands(ulong applicationId,
List<ApplicationCommandRequest> requests) =>
_client.Put<ApplicationCommand[]>($"/applications/{applicationId}/commands",
("ReplaceGlobalApplicationCommands", applicationId), requests);
public Task<ApplicationCommand> CreateGlobalApplicationCommand(ulong applicationId,
ApplicationCommandRequest request) =>
_client.Post<ApplicationCommand>($"/applications/{applicationId}/commands",

View file

@ -4,6 +4,7 @@ namespace Myriad.Rest.Types;
public record ApplicationCommandRequest
{
public ApplicationCommand.ApplicationCommandType Type { get; init; }
public string Name { get; init; }
public string Description { get; init; }
public List<ApplicationCommandOption>? Options { get; init; }