diff --git a/src/helpers/commands/get_slash_command_permission.ts b/src/helpers/commands/get_slash_command_permission.ts new file mode 100644 index 000000000..f34362b9f --- /dev/null +++ b/src/helpers/commands/get_slash_command_permission.ts @@ -0,0 +1,15 @@ +import { applicationId } from "../../bot.ts"; +import { rest } from "../../rest/rest.ts"; +import { GuildApplicationCommandPermissions } from "../../types/interactions/guild_application_command_permissions.ts"; +import { endpoints } from "../../util/constants.ts"; + +/** Fetches command permissions for a specific command for your application in a guild. Returns a GuildApplicationCommandPermissions object. */ +export async function getSlashCommandPermission( + guildId: string, + commandId: string, +) { + return await rest.runMethod( + "get", + endpoints.COMMANDS_PERMISSION(applicationId, guildId, commandId), + ); +}