What are Interactions?
Interactions are commands that users can trigger through Discord’s command interface. In djs-core, there are two types of interactions:- Slash Commands: Typed commands that appear in Discord’s command menu
- Context Menus: Right-click commands that appear when clicking on users or messages
Types of Interactions
Commands (Slash Commands)
Slash commands are typed commands that users can invoke using Discord’s command palette. They can accept various types of options (text, users, channels, etc.) and support autocomplete. Learn more in the Commands guide.Context Menus
Context menus are commands that appear when users right-click on Discord elements (users or messages). They provide quick access to bot functionality directly from the context menu. Learn more in the Context Menus guide.Note on Components
Buttons, select menus, and modals are not interactions - they are components that can be used within command or context menu responses to create interactive experiences.Frequently Asked Questions
What's the difference between commands and context menus?
What's the difference between commands and context menus?
How do I organize my commands?
How do I organize my commands?
Commands are organized using the file structure. For example:
src/interactions/commands/ping.ts→/pingsrc/interactions/commands/admin/kick.ts→/admin kicksrc/interactions/commands/shop/buy.ts→/shop buy
Can I use components in interactions?
Can I use components in interactions?
Yes! Components (buttons, modals, select menus) are designed to be used within command or context menu responses. They enhance interactions by providing interactive UI elements that users can click or interact with.
Do commands auto-register?
Do commands auto-register?
Yes! Commands and context menus are automatically registered when your bot starts. In development mode, all commands are registered on startup. The framework handles all the registration logic for you.