Package Exports
- yamdbf
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 (yamdbf) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
YAMDBF: Yet Another Modular Discord Bot Framework
A Discord.js-based Discord Bot framework to be used as a base for quick bot development.
Usage of the framework is pretty simple. npm install --save yamdbf in your project folder, create a folder to put commands in, rename config.json.example to config.json, fill in the values, and create a basic bot script.
A basic bot script will look something like this
const Bot = require('yamdbf').Bot;
const config = require('./config.json');
const path = require('path');
const bot = new Bot({
name: 'bot',
token: config.token,
config: config,
selfbot: false,
version: '1.0.0',
statusText: 'try @mention help',
commandsDir: path.join(__dirname, 'commands')
}).start();And that's all it takes! Just that and you have a fully functioning bot with the base commands available in the framework. After that you'll just need to write your own commands. I prefer using Babel so that I can use syntax that Node doesn't yet have but for the sake of usability I'll provide an example command using currently-native Node syntax:
let Command = require('yamdbf').Command;
exports.default = class Example extends Command
{
constructor(bot)
{
super(bot, {
name: 'example',
aliases: ['ex, e'],
description: 'An example command',
usage: '<prefix>example',
extraHelp: 'An example command to show the basic boilerplate for writing a command.',
group: 'example',
guildOnly: false,
permissions: [],
roles: [],
ownerOnly: false
});
}
action(message, args, mentions, original)
{
console.log(message.content);
console.log(this.bot.version);
}
};
It should be noted that command actions have access to the Discord.js Client instance via this.bot as seen in the example command above.
That's about it for creating a bot and adding commands. Proper documentation will come soon. 👌

