The commands must follow a certain format
/**
* This method should return the response directly to the channel
* @param {*string array} params
* @param {*message} message
*/
async function command(params, message) {
/**
Command logic
*/
}
/**
* description of the command
*/
const description = "plays ping pong";
/**
* Define Exports
*/
module.exports = {
execute: command,
description: description
};
The next step is to map it in commandlist.js
Modules is bot code that is independent of the commands To add a module, just declare it under modules and require it in modules.js
All settings should be put under settings.json Sample settings.json is already provided
{
"token": "TOKEN_HERE",
"owners": [
"184547913509109761"
],
"identifier": "~",
"delimiter": " "
}
Using the reaction nav provided is simple
msg.react('▶').then(
msg.react('◀')).then(
msg.react('⏩')).then(
msg.react('⏪')
);
bot.emit('addNav', { message: msg, exec: p2str, arr: plist, index: 0 });
/**
message => is the sent message
exec => is a function that works on the values in arr[index] to give a text
arr => array of data
index => start index
**/
Melbot.js comes with a complex music module which spawns new instances of itself and manages the music overload. This makes sure that you have maximum performance always