A highly advanced Discord bot template featuring event handling and command handling with both prefix and slash commands.
- Event Handling
- Command Handling (Prefix + Slash Commands)
- Cooldown Handling
Example Slash Command:
const { SlashCommandBuilder } = require('@discordjs/builders');
module.exports = {
data: new SlashCommandBuilder()
.setName('ping')
.setDescription('Replies with Pong!'),
cooldown: 5,
async execute(interaction) {
await interaction.reply('Pong!');
},
};
Example Prefix Command:
module.exports = {
name: 'ping',
description: 'Replies with Pong!',
cooldown: 5,
execute(message, args) {
message.channel.send('Pong!');
},
};
Example Event:
module.exports = {
name: 'messageCreate',
async execute(message, client) {
if (message.author.bot) return;
if (message.content.toLowerCase().includes('israel')) {
message.reply('Fuck Israel');
}
},
};
If you encounter any bugs, feel free to open an issue or join my Discord server and Contributions are welcome! Be sure to check out the issues tab for ways to help.