diff --git a/src/helpers/commands/get_slash_command_permissions.ts b/src/helpers/commands/get_slash_command_permissions.ts new file mode 100644 index 000000000..4d69204bf --- /dev/null +++ b/src/helpers/commands/get_slash_command_permissions.ts @@ -0,0 +1,12 @@ +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 all commands for your application in a guild. Returns an array of GuildApplicationCommandPermissions objects. */ +export async function getSlashCommandPermissions(guildId: string) { + return await rest.runMethod( + "get", + endpoints.COMMANDS_PERMISSIONS(applicationId, guildId), + ); +}