From ef7ae71f05fbaf693d1e64a6c0f644d20b101373 Mon Sep 17 00:00:00 2001 From: ITOH <72305210+itohatweb@users.noreply.github.com> Date: Sun, 25 Apr 2021 16:32:04 +0200 Subject: [PATCH] Create edit_slash_command_permissions.ts --- .../commands/edit_slash_command_permissions.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/helpers/commands/edit_slash_command_permissions.ts 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, + ); +}