No description
| src | ||
| .gitignore | ||
| Dockerfile | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
Environment Variables
- BOT_TOKEN - The Discord Bot Token
- CLIENT_ID - The Discord App Client ID (Required for Registering Slash Commands)
- GUILD_ID - The ID of the Bot's Server (Optional for Server Specific Slash Commands)
Command Handler
Commands are stored as .ts files in the src/commands directory. They use the following format:
const { SlashCommandBuilder } = require('discord.js');
module.exports = {
data: new SlashCommandBuilder()
.setName('Name')
.setDescription('Description'),
async execute(interaction) {
// Insert Code Here
}
}
When Commands are Added/Removed, They must be registered to Discord. You can do this by running npx tsx src/deployCommands.ts. If you want commands to be deployed to a Specific Server, Provide the Server ID in the GUILD_ID Envirionment Variable.
Event Handler
Events are stored as .ts files in the src/events directory. They use the following format:
const { Events } = require('discord.js');
module.exports = {
name: Events.EVENT_NAME,
once: boolean, // Whether the Event shall run once
execute(client) {
// Insert Code Here
},
};