1.1.12 • Published 7 years ago

dratini v1.1.12

Weekly downloads
7
License
WTFPL
Repository
github
Last release
7 years ago

Dratini

Dratini is an Eris based Discord bot framework that allows developers to create commands declaratively. The goal of Dratini is to provide developers an easier way to create commands. Using Dratini, developers do not need to parse any messages themselves as Dratini will provide already-parsed arguments based off of pre-defined command structures.

Installing

npm install dratini

Available Command Argument Types

Arguments
BooleanArgument
NumberArgument
StringArgument
ListArgument
VariadicArgument
MemberArgument

Or

Example Command

const Eris = require('eris');
const conf = require('./conf.json');
const eris = new Eris(conf.bot_token);
const Dratini = require('./lib/dratini.js');
const Command = require('./lib/command.js');
const Arguments = require('./lib/args/arguments.js');
const StringArgument = require('./lib/args/stringargument.js');
const NumberArgument = require('./lib/args/numberargument.js');
const MemberArgument = require('./lib/args/memberargument.js');

const bot = new Dratini();
bot.init(eris, conf.prefix);

function remindMe(args, ctx){
	// ...
}

bot.register(new Command(
    new Arguments([
        'remind',
        'me',
        new Arguments([
            'to'
        ], {required: false}),
        new StringArgument('reminder'),
        new Arguments([
            'in'
        ], {required: false}),
        new Arguments([
            new NumberArgument('hours'),
            'hours'
        ], {required: false}),
        new Arguments([
            new NumberArgument('minutes'),
            'minutes'
        ], {required: false}),
        new Arguments([
            new NumberArgument('seconds'),
            'seconds'
        ], {required: false})
    ], {
        defaults: {
            hours: 0,
            minutes: 0,
            seconds: 0
        }
    }), remindMe,
    {
        desc: 'Set a reminder for something.'
    }
));

eris.connect();
1.1.12

7 years ago

1.1.11

7 years ago

1.1.10

7 years ago

1.1.9

7 years ago

1.1.8

7 years ago

1.1.7

7 years ago

1.1.6

7 years ago

1.1.5

7 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago