Package Exports
- sbf4d
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (sbf4d) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
SBF4D
Simple Bot Framework For Discord
Installation
$ npm install sbf4d --saveUsage
This module extends the discord.js module so all discord.js methods found here can be used.
Start Bot
./bot.js
const sbf4d = require('sbf4d');
const path = require('path');
let bot = new sbf4d.Client({
commandPrefix: '!',
owner: 'Y O U R D I S C O R D I D',
commandGroups: [
{id: 'test', name:'Test Commands'}
],
commandsPath: path.join(__dirname, './commands')
});
bot.on('ready', ()=> {
console.log('Bot Running!');
});
bot.login('Y O U R T O K E N');Example Command
All commands are placed inside the root commands folder and then under the name of their group.
./commands/test/foo.js
let {Command} = require('sbf4d');
module.exports = class FooCommand extends Command {
constructor(client) {
super(client, {
name: 'Foo',
group: 'test',
aliases: [
'f'
],
throttling: 2000
})
}
run(msg, args) {
msg.reply('bar');
}
};