coxinha
TypeScript icon, indicating that this package has built-in type declarations

2.11.0 • Public • Published

Coxinha

Basic command system for discord.js written in typescript

Sample bot in examples/

Example

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');

Readme

Keywords

Package Sidebar

Install

npm i coxinha

Weekly Downloads

2

Version

2.11.0

License

MIT

Unpacked Size

28.5 kB

Total Files

19

Last publish

Collaborators

  • mat44