discord_app
Define and serve Discord application commands.
By leveraging TypeScriptâs type system, discord_app
ensures type-safety in
defining application commands, utilizing your schema to inject type information
into your handlers.
Application commands are native ways to interact with apps in the Discord client. There are 3 types of commands accessible in different interfaces: the chat input, a messageâs context menu (top-right menu or right-clicking in a message), and a userâs context menu (right-clicking on a user).
Usage
Note
The discord_app
library is currently only known to be available in Deno.
Examples
Message commands
Message commands are application commands that appear on the context menu (right click or tap) of messages. Theyâre a great way to surface quick actions for your app that target messages. They donât take any arguments, and will return the message on whom you clicked or tapped in the interaction response.
In discord_app
,
message commands
are created and served as demonstrated in
/examples/bookmark.ts
.
User commands
User commands are application commands that appear on the context menu (right click or tap) of users. Theyâre a great way to surface quick actions for your app that target users. They donât take any arguments, and will return the user on whom you clicked or tapped in the interaction response.
In discord_app
,
user commands
are created and served as demonstrated in
/examples/high_five.ts
.
Chat input commands
For those developers looking to make more organized and complex groups of commands, look no further than subcommands and groups.
Subcommands organize your commands by specifying actions within a command or group.
Subcommand Groups organize your subcommands by grouping subcommands by similar action or resource within a command.
These are not enforced rules. You are free to use subcommands and groups however youâd like; itâs just how we think about them.
In discord_app
,
chat input commands,
also known as âslash commandsâ, are created and served as demonstrated in the
following example files:
/examples/blep.ts
. This is a simple application with a single command./examples/permissions.ts
. This is a single command with grouped subcommands.
Contributing
Contributions to the project are welcome. Feel free to open an issue or pull request!
Developed with đ by @EthanThatOneKid