diff --git a/src/api/handlers/mod.ts b/src/api/handlers/mod.ts index 06e7e2c5c..9de0e938d 100644 --- a/src/api/handlers/mod.ts +++ b/src/api/handlers/mod.ts @@ -116,6 +116,7 @@ import { editWebhookMessage, executeSlashCommand, executeWebhook, + getSlashCommand, getSlashCommands, getWebhook, upsertSlashCommand, @@ -237,6 +238,7 @@ export let handlers = { editWebhookMessage, deleteWebhookMessage, createSlashCommand, + getSlashCommand, getSlashCommands, upsertSlashCommand, editSlashCommand, diff --git a/src/api/handlers/webhook.ts b/src/api/handlers/webhook.ts index bec85f4ea..fc04553c4 100644 --- a/src/api/handlers/webhook.ts +++ b/src/api/handlers/webhook.ts @@ -20,10 +20,11 @@ import { botHasChannelPermissions } from "../../util/permissions.ts"; import { urlToBase64 } from "../../util/utils.ts"; import { structures } from "../structures/mod.ts"; -/** Create a new webhook. Requires the MANAGE_WEBHOOKS permission. Returns a webhook object on success. Webhook names follow our naming restrictions that can be found in our Usernames and Nicknames documentation, with the following additional stipulations: -* -* Webhook names cannot be: 'clyde' -*/ +/** + * Create a new webhook. Requires the MANAGE_WEBHOOKS permission. Returns a webhook object on success. Webhook names follow our naming restrictions that can be found in our Usernames and Nicknames documentation, with the following additional stipulations: + * + * Webhook names cannot be: 'clyde' + */ export async function createWebhook( channelID: string, options: WebhookCreateOptions, @@ -310,7 +311,7 @@ export function deleteSlashCommand(id: string, guildID?: string) { return RequestManager.delete(endpoints.COMMANDS_ID(applicationID, id)); } return RequestManager.delete( - endpoints.COMMANDS_GUILD_ID(applicationID, id, guildID), + endpoints.COMMANDS_GUILD_ID(applicationID, guildID, id), ); } @@ -339,7 +340,7 @@ export function executeSlashCommand( Date.now() + 900000, ); - // IF NO MENTIONS ARE PROVIDED, FORCE DISABLE MENTIONS + // If no mentions are provided, force disable mentions if (!(options.data.allowed_mentions)) { options.data.allowed_mentions = { parse: [] }; } diff --git a/src/util/constants.ts b/src/util/constants.ts index a23292ba9..afad4433c 100644 --- a/src/util/constants.ts +++ b/src/util/constants.ts @@ -143,8 +143,8 @@ export const endpoints = { `${baseEndpoints.BASE_URL}/applications/${applicationID}/commands/${commandID}`, COMMANDS_GUILD_ID: ( applicationID: string, - commandID: string, guildID: string, + commandID: string, ) => `${baseEndpoints.BASE_URL}/applications/${applicationID}/guilds/${guildID}/commands/${commandID}`,