Navrin / djs-decorated-commands

A typescript focused approach to discordjs command routing.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Discord.JS Decorated Commands

This is a project to bring the excellent syntaxical sugar of decorators to the world of Discord.JS command routing. Commands are described via decorators, and classes describe the categories. The basic concept for this library is.

@Category({
    name: 'utils',
})
class Utilities {
    @command('ping')
    ping({ msg }: CommandParams) {
        msg.reply('Pong!');
    }

    @command({
        name: 'say_hello',
        aliases: ['hi_bot', 'heya_bot!'],
        unscoped: true, // doesn't require !utils hi_bot, just !hi_bot
    })
    greeter({ msg }: CommandParams) {
        msg.reply(`Hello, ${msg.author.tag}!`);
    }
}

About

A typescript focused approach to discordjs command routing.

License:MIT License


Languages

Language:TypeScript 100.0%