No description
Find a file Use this template
2026-01-18 01:00:12 -06:00
src Command and Event Handlers 2026-01-18 01:00:12 -06:00
.gitignore Bot Base 2026-01-17 23:51:20 -06:00
Dockerfile Command and Event Handlers 2026-01-18 01:00:12 -06:00
package-lock.json Bot Base 2026-01-17 23:51:20 -06:00
package.json Bot Base 2026-01-17 23:51:20 -06:00
README.md Command and Event Handlers 2026-01-18 01:00:12 -06:00

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
	},
};