Easier and simpler command handling! No longer need to restart your bot when your editing a command or want to add/remove one^^
Features:
- built in reload function(instead of restarting bot do reload to load in all your commands).
- built in commands function(to show all loaded commands).
- 2 commands included in the command foler(userinfo.js and ping.js). Do prefix + commands to see all commands.
Title | Author | Description |
---|---|---|
PS2stats | l0b5ter | Show planetside2 players info! This works with every pc server including ps4 servers. |
COVID-19 \ Corona | l0b5ter | Keep track of Corona Virus(COVID-19) cases via rapidapi API. 21 pages totally! |
Wanna add more commands to your bot? Just look at one of the commands and see how i managed to do it^^
At the top add these lines:
client.commands = new Discord.Collection();
var Collection = client.commands;
var jsfiles = new Array();
const fs = require("fs");
So it becomes something like this
const client = new Discord.Client();
const { token, prefix, ChannelPost } = require('./config.json');
client.commands = new Discord.Collection();
var Collection = client.commands;
var jsfiles = new Array();
const fs = require("fs");
Then under "client.on('ready', () => {" or "bot.on('ready', () => {" put this:
[jsfiles, Collection] = require("./MsgModule/MsgHandler.js").GetCommands(client);
like this
client.on('ready', () => {
console.log('The bot is Online!');
[jsfiles, Collection] = require("./MsgModule/MsgHandler.js").GetCommands(client);
});
Finnaly we add the last bit of code needed to get it to work. which is under the "client.on('message', message => {" or "bot.on('message', message => {".
var Collection2 = require("./MsgModule/MsgHandler.js").run(client, message, prefix, jsfiles, ChannelPost, Collection);
Collection = Collection2;
like this
client.on('message', message => {
var Collection2 = require("./MsgModule/MsgHandler.js").run(client, message, prefix, jsfiles, ChannelPost, Collection);
Collection = Collection2;
});