Skip to main content
Module

x/discord_api_types/payloads/v9/_interactions/_applicationCommands/permissions.ts

Up to date Discord API Typings, versioned by the API version
Go to Latest
File
import type { Snowflake } from '../../../../globals.ts';
/** * https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-guild-application-command-permissions-structure */export interface APIGuildApplicationCommandPermissions { /** * The id of the command or the application id if that permission applies to all commands */ id: Snowflake; /** * The id of the application the command belongs to */ application_id: Snowflake; /** * The id of the guild */ guild_id: Snowflake; /** * The permissions for the command in the guild */ permissions: APIApplicationCommandPermission[];}
/** * https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-application-command-permissions-structure */export interface APIApplicationCommandPermission { /** * The id of the role, user or channel. Can also be a permission constant */ id: Snowflake; /** * Role, user or channel */ type: ApplicationCommandPermissionType; /** * `true` to allow, `false`, to disallow */ permission: boolean;}
/** * https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-application-command-permission-type */export enum ApplicationCommandPermissionType { Role = 1, User, Channel,}
/** * https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-application-command-permissions-constants */export const APIApplicationCommandPermissionsConstant = { Everyone: (guildId: string | bigint): Snowflake => String(guildId), AllChannels: (guildId: string | bigint): Snowflake => String(BigInt(guildId) - 1n),};