Skip to main content
Deno 2 is finally here 🎉️
Learn more

discord_app

deno doc

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:

Contributing

Contributions to the project are welcome. Feel free to open an issue or pull request!


Developed with 💜 by @EthanThatOneKid