discord-bot-lib
A basic discord bot lib for node.js but the library doesn't cache discord objects.
Installation
$ npm install discord-bot-lib
Key points
- Simple command handler.
- Simple handler for slash commands.
- This lib does NOT cache external discord objects.
- This lib does NOT support voice (sorry music bots)
- This lib gives you full control on how you cache discord data.
- This lib gives you full control on how you handle discord gateway events.
- Really customizable.
Links and Sections
Simple Bot Example
const Client = require('discord-bot-lib');
const bot = new Client({
token: "Discord Token",
prefix: "/"
});
bot.addEventListener('ready', data => {
console.log(`The bot is ready! Serving ${data.guilds.length} guilds.`);
});
bot.addEventListener('error', async (ctx, err) => {
await ctx.send(`Whoopsies! The bot did an oopsie woopsie!\n\`${err}\``);
});
bot.addEventListener('close', () => console.log("Goodbye, world! :c"));
bot.command({
name: "ping",
aliases: ["pong"],
run: async (ctx) => {
return await ctx.send('Pong');
}
});
bot.run();