1.3.5 • Published 3 years ago
discord-bot-lib v1.3.5
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
- GitHub Repository
- Simple Bot Example
- Documentation
- Examples
- Simple avatar command
- Working with buttons
- Integrating with node-canvas
- Adding a cooldown to a command
- Deleting a message
- DMing the message author
- Editing a message
- Creating a message embed
- Handling HTTP exceptions
- Creating a select menu
- Creating an advanced server info command
- Creating an advanced user info command
- Waiting for a message response
Simple Bot Example
// require the lib
const Client = require('discord-bot-lib');
// create the client
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"));
// simple command handler example
bot.command({
name: "ping",
aliases: ["pong"],
run: async (ctx) => {
return await ctx.send('Pong');
}
});
// run the bot
bot.run();
1.3.5
3 years ago
1.3.4
3 years ago
1.3.3
3 years ago
1.3.2
3 years ago
1.3.1
3 years ago
1.3.0
3 years ago
1.2.8
3 years ago
1.2.7
3 years ago
1.2.6
3 years ago
1.2.5
3 years ago
1.2.4
3 years ago
1.2.9
3 years ago
1.2.3
3 years ago
1.2.0
3 years ago
1.1.9
3 years ago
1.1.8
3 years ago
1.1.7
3 years ago
1.2.2
3 years ago
1.2.1
3 years ago
1.1.5
3 years ago
1.1.4
3 years ago
1.1.3
3 years ago
1.1.2
3 years ago
1.1.1
3 years ago
1.1.0
3 years ago
1.0.2
3 years ago
1.0.1
3 years ago
1.0.3
3 years ago
1.0.0
3 years ago