1.0.2 • Published 3 years ago
sbf4d_ts v1.0.2
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');
}
}