A Discord Bot framework built on top of discord.js that allows you to focus on what makes your bot unique.
npm install discordbox
The following example shows how to create and start a bot that registers a slash command called ping
that replies with Pong!
when used.
import { SlashCommandBuilder } from 'discord.js'
import { DiscordBot } from 'discordbox'
const bot = new DiscordBot({
token: 'xxxxxxxxxxxxxxxxxx',
guildId: 'xxxxxxxxxxxxxxxxxx',
clientId: 'xxxxxxxxxxxxxxxxxx',
supportUserId: 'xxxxxxxxxxxxxxxxxx',
})
const ping = {
action: new SlashCommandBuilder()
.setName('ping')
.setDescription('sends Pong!'),
callback: async (interaction) => {
await interaction.reply({ content: 'Pong!', ephemeral: true })
},
}
bot.addGenericInteractions([ping])
await bot.start()
You can find the full documentation on docs.discordbox.dev.
Contributions are welcome, feel free to open an issue or submit a pull request.
This project is licensed under the Apache-2.0 License - see the LICENSE file for details.