Interactions
TSCord uses decorators from discordx
to handle interactions.
caution
Because the template is overriding the default behavior of some of these decorators, you should always import them from @decorators
rather than discordx
!
Here is a relevant list of them, linked to the corresponding discordx documentation:
- Commands
- GUI Interactions
Responding to interactions
TSCord is deferring every command interaction (slashes and context menus) by default, so you should use .followUp()
instead of .reply()
.
If you want to get rid of this automatic deferring, you can delete the following lines in the src/events/interactionCreate
:
// defer the reply
if (interaction instanceof CommandInteraction) await interaction.deferReply()
There's also the replyToInteraction()
util function that abstract the response to either an interaction or a simple command message.
Built-in commands
There are several built-in slash commands:
- General
- Admin
- Owner
Command name | Description |
---|---|
help | Get all the commands and their descriptions, grouped by categories |
info | Show general information about the bot |
invite | Give the link to invite the bot on any server |
ping | Pong! |
stats | Display stats like total amount of users using the bot, number of guilds, etc |
Command name | Description |
---|---|
prefix | Change the prefix of the bot on the guild |
Command name | Description |
---|---|
maintenance | Toggle on/off maintenance mode |
eval | Execute code directly from discord (for testing purposes) (VERY DANGEROUS) |