diff --git a/src/helpers/commands/edit_slash_command_permissions.ts b/src/helpers/commands/edit_slash_command_permissions.ts new file mode 100644 index 000000000..5617f3a9d --- /dev/null +++ b/src/helpers/commands/edit_slash_command_permissions.ts @@ -0,0 +1,17 @@ +import { applicationId } from "../../bot.ts"; +import { rest } from "../../rest/rest.ts"; +import { ApplicationCommandPermissions } from "../../types/interactions/application_command_permissions.ts"; +import { endpoints } from "../../util/constants.ts"; + +/** Edits command permissions for a specific command for your application in a guild. */ +export async function editSlashCommandPermissions( + guildId: string, + commandId: string, + options: ApplicationCommandPermissions[], +) { + return await rest.runMethod( + "put", + endpoints.COMMANDS_PERMISSION(applicationId, guildId, commandId), + options, + ); +}