Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kibotrel/discordbox

Framework to build Discord bot with. Handles the boring stuff so that you can focus on what makes your bot unique.
https://github.com/kibotrel/discordbox

discord discord-bot discord-js framework typescript

Last synced: 13 days ago
JSON representation

Framework to build Discord bot with. Handles the boring stuff so that you can focus on what makes your bot unique.

Awesome Lists containing this project

README

        


DiscordBox logo

DiscordBox


A Discord Bot framework built on top of discord.js that allows you to focus on what makes your bot unique.

[![npm](https://img.shields.io/npm/v/discordbox)](https://www.npmjs.com/package/discordbox)
[![CodeFactor](https://www.codefactor.io/repository/github/kibotrel/discordbox/badge?s=1459584c7b64ad6f067146acc6cf10108516a45f)](https://www.codefactor.io/repository/github/kibotrel/discordbox)
![GitHub License](https://img.shields.io/github/license/kibotrel/DiscordBox)

## 📦 Install

```sh
npm install discordbox
```

## 🚀 Getting started

The following example shows how to create and start a bot that registers a slash command called `ping` that replies with `Pong!` when used.

```js
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()
```

## 📖 Documentation

You can find the full documentation on [docs.discordbox.dev](https://docs.discordbox.dev).

## ✨ Contributing

Contributions are welcome, feel free to open an issue or submit a pull request.

## 🔑 License

This project is licensed under the Apache-2.0 License - see the [LICENSE](LICENSE) file for details.