https://github.com/RuskyDev/discord-bot-template
A highly advanced Discord bot template featuring event handling and command handling with both prefix and slash commands.
https://github.com/RuskyDev/discord-bot-template
bot commands cooldown discord handler nodejs prefix slash template v14
Last synced: 10 months ago
JSON representation
A highly advanced Discord bot template featuring event handling and command handling with both prefix and slash commands.
- Host: GitHub
- URL: https://github.com/RuskyDev/discord-bot-template
- Owner: RuskyDev
- License: mit
- Created: 2024-09-17T18:36:29.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-14T10:12:54.000Z (over 1 year ago)
- Last Synced: 2024-12-21T14:22:41.499Z (over 1 year ago)
- Topics: bot, commands, cooldown, discord, handler, nodejs, prefix, slash, template, v14
- Language: JavaScript
- Homepage: https://rusky.is-a.dev
- Size: 32.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Discord Bot Template
An advanced template for Discord bots with event handling, prefix and slash commands, user app support, cooldown management, and many customization options.
## Features
- Easy event handling
- Works with prefix and slash commands
- Supports user apps
- Manages cooldowns efficiently
- A lot of customization options for different bot functionalities
## Templates
Example Slash Command:
```js
const { SlashCommandBuilder } = require('@discordjs/builders');
module.exports = {
data: new SlashCommandBuilder()
.setName('ping')
.setDescription('Replies with Pong!')
.setIntegrationTypes(0, 1) // 0 for Guild Install, 1 for User Install
.setContexts(0, 1, 2), // 0 for Guild, 1 for Bot DM, 2 for Group Chat
cooldown: 5,
async execute(interaction) {
await interaction.reply('Pong!');
},
};
```
Example Prefix Command:
```js
module.exports = {
name: 'ping',
description: 'Replies with Pong!',
cooldown: 5,
execute(message, args) {
message.channel.send('Pong!');
},
};
```
Example Event:
```js
module.exports = {
name: 'messageCreate',
async execute(message, client) {
if (message.author.bot) return;
if (message.content.toLowerCase().includes('israel')) {
message.reply('Fuck Israel');
}
},
};
```
Example .env File:
```bash
DISCORD_BOT_TOKEN=
DISCORD_BOT_CLIENT_ID=
```
## Contributions & Bug Reports
If you encounter any bugs, feel free to open an [issue](https://github.com/RuskyDev/discord-bot-template/issues) or join my [Discord server](https://discord.gg/MAnvhWJvsC). Contributions are welcome! Be sure to check out the [issues](https://github.com/RuskyDev/discord-bot-template/issues) tab for ways to help.