swc/crates/swc_bundler/tests/.cache/deno/0a96f91ab9a6d6c195b5722e00c81d4bc5feb7e6.ts
2021-11-09 20:42:49 +09:00

16 lines
779 B
TypeScript

// Loaded from https://deno.land/x/discordeno@11.0.0-rc.2/src/helpers/interactions/commands/get_slash_command_permissions.ts
import { applicationId } from "../../../bot.ts";
import { rest } from "../../../rest/rest.ts";
import type { GuildApplicationCommandPermissions } from "../../../types/interactions/commands/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: bigint) {
return await rest.runMethod<GuildApplicationCommandPermissions[]>(
"get",
endpoints.COMMANDS_PERMISSIONS(applicationId, guildId)
);
}