This is a library to create Discord bots. It is a Discord implementation of the @totigm/bot-builder package, which handles all the commands stuff behind the scenes, so you can focus on your bot's logic.
The discord.js v12 library is being used.
- Reference documentation
- Options
- Set up a discord bot
- Discord.js v12 docs
- Bot builder
- WhatsApp bot
- GitHub
- NPM
npm i @totigm/discord-bot
or
yarn add @totigm/discord-bot
Check this tutorial on how to create a discord bot.
Start adding commands to your bot by checking the reference documentation.
import DiscordBot from "@totigm/discord-bot";
const bot = new DiscordBot("YOUR_DISCORD_BOT_TOKEN");
bot.addCommand("hey", (message) => `Hey ${message.author.username}! How are you doing?`, {
description: "Say hey",
explanation: "The bot will say hey to the user using their Discord's name",
example: {
output: "Hey Toti! How are you doing?",
},
});
The previous code will create a bot that works like this:
When you create a bot, you can pass an options object to customize it. Check its options documentation for more information.
const options = { ... };
const bot = new DiscordBot("YOUR_BOTS_TOKEN", options);
Contributions are more than welcome!
We think that you might have great ideas to make this project even better. If you do, please create a pull request and/or issue following the contribution guidelines.
Give a ⭐️ if this project helped you!
Copyright © 2022 Toti Muñoz.
This project is MIT licensed.
This project was made with ❤ and TypeScript