You can contribute to Wump by creating your own command, this is very easy if you have a basic understanding of Node.JS
Every command has extData, this basically is the command-specific settings object, it's structured as followed:
_base.jscmd.extData = {// Informationpath : undefined, // The config path of the command [`wump.utility.ping` for example] ( optional )name : null, // Command name ( required )syntax : null, // Command syntax ( optional )bearer : 'wump', // Command bearer ( required )aliases : [], // Command aliases ( optional )argument : [], // Command arguments ( optional )description: null, // Command description ( optional )// Checkshidden : false, // Hidden from view ( true / false )enabled : true, // Enabled or disabled ( true / false )cooldown : 1000, // Command cooldown ( optional )category : 'General', // Command category ( required )ownerOnly : false, // Owner only ( true / false )guildOnly : false, // Guild only ( true / false )permissions: [] // Bot permissions ( optional )}
A command is structured as followed:
_base.jsconst { DiscordCommand } = requir e('../../core');/*Replace <name> with your command's nameReplace <syntax> with your command's syntaxReplace <author> with your nameReplace <description> with your description*/module.exports = class <name> extends DiscordCommand {constructor(bot) {super(bot, {path : undefined,name : '<name>',syntax : '<syntax>',bearer : '<author>',aliases : [],argument : [],description: '<description>',hidden : false,enabled : true,cooldown : 1000,category : 'Utility',ownerOnly : false,guildOnly : false,permissions: []});Object.freeze(this);Object.freeze(this.static);}async execute(msg, args, user, guild) {// ...}_localize(msg, extData = {}) {try {if (!msg) throw 'INVALID_STRING';// ...} catch (ex) {return `LOCALIZE_ERROR:${ex.code}`;}}};
A command should be put inside of Command.emit
as followed:
_base.jsemit(msg, args, user, guild) {console.log(msg, args, user, guild);// Localizingconsole.log(this._localize(msg.author.locale.cooldown, msg.author);}
Localizing is done with the private Command._localize
function as followed:
_base.js_localize(msg, extData = {}) {try {if (!msg) throw 'INVALID_STRING';return msg.replace(/{e\.user\.id}/, extData.id)} catch (ex) {return `LOCALIZE_ERROR:${ex.code}`;}}
After you've tested and linted your command, you can submit it by creating a pull request on GitHub. It may take some time for your pull request to be reviewed