From 5826da22e30839b1f9fcd73479f8bc0f213001bd Mon Sep 17 00:00:00 2001 From: Vlad Frangu Date: Tue, 26 Jan 2021 23:47:37 +0200 Subject: [PATCH] feat: add GET single Application Command (#76) --- common/index.ts | 4 ++++ v8/rest/index.ts | 2 ++ v8/rest/interactions.ts | 10 ++++++++++ 3 files changed, 16 insertions(+) diff --git a/common/index.ts b/common/index.ts index b59b4ad4..45d65981 100644 --- a/common/index.ts +++ b/common/index.ts @@ -30,6 +30,10 @@ export const enum RESTJSONErrorCodes { UnknownRedistributable = 10036, + UnknownGuildTemplate = 10057, + + UnknownApplicationCommand = 10063, + BotsCannotUseThisEndpoint = 20001, OnlyBotsCanUseThisEndpoint, diff --git a/v8/rest/index.ts b/v8/rest/index.ts index 75ffb56a..d7b0dc0f 100644 --- a/v8/rest/index.ts +++ b/v8/rest/index.ts @@ -583,6 +583,7 @@ export const Routes = { /** * Route for: + * - GET `/applications/{application.id}/commands/{command.id}` * - PATCH `/applications/{application.id}/commands/{command.id}` * - DELETE `/applications/{application.id}/commands/{command.id}` */ @@ -601,6 +602,7 @@ export const Routes = { /** * Route for: + * - GET `/applications/{application.id}/guilds/{guild.id}/commands/{command.id}` * - PATCH `/applications/{application.id}/guilds/{guild.id}/commands/{command.id}` * - DELETE `/applications/{application.id}/guilds/{guild.id}/commands/{command.id}` */ diff --git a/v8/rest/interactions.ts b/v8/rest/interactions.ts index f3fc7525..ac04e31b 100644 --- a/v8/rest/interactions.ts +++ b/v8/rest/interactions.ts @@ -5,6 +5,11 @@ import type { APIApplicationCommand, APIInteractionResponse } from '../payloads/ */ export type RESTGetAPIApplicationCommandsResult = APIApplicationCommand[]; +/** + * https://discord.com/developers/docs/interactions/slash-commands#get-global-application-command + */ +export type RESTGetAPIApplicationCommandResult = APIApplicationCommand; + /** * https://discord.com/developers/docs/interactions/slash-commands#create-global-application-command */ @@ -30,6 +35,11 @@ export type RESTPatchAPIApplicationCommandResult = APIApplicationCommand; */ export type RESTGetAPIApplicationGuildCommandsResult = APIApplicationCommand[]; +/** + * https://discord.com/developers/docs/interactions/slash-commands#get-guild-application-command + */ +export type RESTGetAPIApplicationGuildCommandResult = APIApplicationCommand; + /** * https://discord.com/developers/docs/interactions/slash-commands#create-guild-application-command */