Skip to content

Commit

Permalink
Add common application enums
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeckwith committed Sep 19, 2024
1 parent f2fd09d commit e2cf0a8
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 50 deletions.
115 changes: 65 additions & 50 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 45 additions & 0 deletions src/application.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/**
* @see {@link https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-types}
*/
export enum ApplicationCommandType {
CHAT_INPUT = 1,
USER = 2,
MESSAGE = 3,
PRIMARY_ENTRY_POINT = 4,
}

/**
* Where an app can be installed, also called its supported installation contexts.
* @see {@link https://discord.com/developers/docs/resources/application#application-object-application-integration-types}
*/
export enum ApplicationIntegrationType {
GUILD_INSTALL = 0,
USER_INSTALL = 1,
}

/**
* Context in Discord where an interaction can be used, or where it was triggered from. Details about using interaction contexts for application commands is in the commands context documentation.
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-context-types}
*/
export enum ApplicationInteractionContextType {
GUILD = 0,
BOT_DM = 1,
PRIVATE_CHANNEL = 2,
}

/**
* @see {@link https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-types}
*/
export enum ApplicationCommandOptionType {
SUB_COMMAND = 1,
SUB_COMMAND_GROUP = 2,
STRING = 3,
INTEGER = 4,
BOOLEAN = 5,
USER = 6,
CHANNEL = 7,
ROLE = 8,
MENTIONABLE = 9,
NUMBER = 10,
ATTACHMENT = 11,
}
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,3 +206,4 @@ export function verifyKeyMiddleware(
}

export * from './components';
export * from './application';

0 comments on commit e2cf0a8

Please sign in to comment.