auto reload commads

This commit is contained in:
ChomeNS 2022-10-22 17:38:24 +07:00
parent c76b9a0b29
commit 4fa5dc50c0

View file

@ -5,8 +5,12 @@ const loadFiles = require('../util/load_files');
const path = require('path');
const {MessageEmbed} = require('discord.js');
function inject(bot, dcclient) {
bot.command_handler.commands = loadFiles(path.join(__dirname, '../commands'));
function reload() {
bot.command_handler.commands = loadFiles(path.join(__dirname, '../commands'));
}
reload();
bot.command_handler.main = function(prefix, username, usernameraw, message, sender, channeldc) {
reload();
let raw;
let command;
if (typeof message.content!=='undefined') raw = message.content.substring(prefix.length);