1.0.2 • Published 3 years ago

sbf4d_ts v1.0.2

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
3 years ago

SBF4D-Typescript

Simple Bot Framework For Discord Rewrite With Typescript. I just rewrote SBF4D in Typescript.

Installation

$ npm install sbf4d_ts

Usage

This module extends the discord.js module so all discord.js methods found here can be used.

Start Bot

./index.ts

import * as path from 'path';
import * as sbf4d from '../src/Index';

let bot = new sbf4d.Client({
    commandPrefix: 'prefix',
    owner: 'id',
    commandGroups: [
        {id: 'test', name:'Test Commands'}
    ],
    commandsPath: path.join(__dirname, './commands')
});

bot.on('ready', ()=> {
    console.log('Bot Running!');
});

bot.login('token');

Example Command

All commands are placed inside the root commands folder and then under the name of their group.

./commands/test/foo.ts

import { Command } from 'sbf4d_ts';

export default class FooCommand extends Command {
    constructor(client) {
        super(client, {
            name: 'Foo',
            group: 'test',
            aliases: [
                'f'
            ],
            throttling: 2000
        })
    }

    run(msg, args) {
        msg.reply('bar');
    }
}
1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago