https://github.com/definitive-networks/discord-bot
A simple and flexible bot framework using Discord.js v13
https://github.com/definitive-networks/discord-bot
discord discord-bot discordjs framework nodejs
Last synced: 6 months ago
JSON representation
A simple and flexible bot framework using Discord.js v13
- Host: GitHub
- URL: https://github.com/definitive-networks/discord-bot
- Owner: definitive-networks
- License: mit
- Archived: true
- Created: 2021-07-11T19:38:33.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-03-06T06:31:17.000Z (about 3 years ago)
- Last Synced: 2024-02-18T18:20:40.823Z (about 2 years ago)
- Topics: discord, discord-bot, discordjs, framework, nodejs
- Language: JavaScript
- Homepage: https://github.com/definitive-networks/discord-bot/wiki
- Size: 595 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
Discord.js · Quick.db
---
## About
Discord Bot isn't a bot, but a simple and flexible framework using [discord.js](https://github.com/discordjs/discord.js), so that you can get your own bot up and running quick.
- [Quick.db](https://quickdb.js.org/) integrated for easy access to persistent storage (also used for Slash Commands)
- Command aliases and permissions
- `interactionButton` and `interactionSelect` events
- No forced features
## Installation
Ensure you have [Node.js](https://nodejs.org/) 14.0.0 or higher installed, then run:
```sh-session
npm install discord.js@dev quick.db @definitive-networks/discord-bot
```
## Example Usage
```js
// ./index.js
const path = require('path');
const DiscordBot = require('@definitive-networks/discord-bot');
const client = new DiscordBot({
botDir: path.resolve(__dirname),
defaultPrefix: '?',
intents: ['GUILDS', 'GUILD_MESSAGES']
});
client.start(/*DISCORD BOT TOKEN*/);
```
##### Command Example
```js
// ./commands/ping.js
module.exports = {
name: 'ping',
description: 'Ping the bot',
aliases: ['ms'],
execute(message, args, client) {
message.channel.send(`Pong! \`${Date.now() - message.createdTimestamp}ms\``);
},
SlashCommand: {
execute(interaction, args, client) {
interaction.reply(`Pong! \`${Date.now() - interaction.createdTimestamp}ms\``);
}
}
}
```
##### Event Example
```js
// ./events/ready.js
module.exports = {
name: 'ready',
once: true,
execute(client) {
console.log(`Logged in as: ${client.user.tag}`);
}
}
```
## Documentation
Check out the [wiki](https://github.com/definitive-networks/discord-bot/wiki) for more examples and documentation.