Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/matcool/coxinha

yumm coxinha 😋
https://github.com/matcool/coxinha

discord discord-bot-framework discord-js discordjs discordjs-framework

Last synced: about 1 month ago
JSON representation

yumm coxinha 😋

Awesome Lists containing this project

README

        

# Coxinha
Basic command system for discord.js written in typescript

Sample bot in examples/
# Example
```js
const { Bot, Command, Argument } = require('coxinha');

// ! is the prefix
const bot = new Bot('!');

bot.on('ready', () => {
console.log(`Logged in as ${bot.user.tag}!`);
});

bot.addCommand(new Command({
name: 'ping',
aliases: ['pong'],
help: 'Sends "Pong!"',
async func(ctx) {
await ctx.send('Pong!');
}
}));

bot.addCommand(new Command({
name: 'say',
help: 'Sends given message',
args: [
// Combined means it'll be multiple words
new Argument('message', {combined: true})
],
async func(ctx, msg) {
await ctx.send(msg);
}
}));

bot.login('token');
```