mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-02 00:40:07 +00:00
23 lines
854 B
TypeScript
23 lines
854 B
TypeScript
import type { ApplicationCommandPermissions } from "../../../types/interactions/commands/applicationCommandPermissions.ts";
|
|
import type { Bot } from "../../../bot.ts";
|
|
import { GuildApplicationCommandPermissions } from "../../../types/interactions/commands/guildApplicationCommandPermissions.ts";
|
|
|
|
/** Edits command permissions for a specific command for your application in a guild. */
|
|
export async function editApplicationCommandPermissions(
|
|
bot: Bot,
|
|
guildId: bigint,
|
|
commandId: bigint,
|
|
options: ApplicationCommandPermissions[],
|
|
) {
|
|
const result = await bot.rest.runMethod<GuildApplicationCommandPermissions>(
|
|
bot.rest,
|
|
"put",
|
|
bot.constants.endpoints.COMMANDS_PERMISSION(bot.applicationId, guildId, commandId),
|
|
{
|
|
permissions: options,
|
|
},
|
|
);
|
|
|
|
return bot.transformers.applicationCommandPermission(bot, result);
|
|
}
|