FNFBoyfriendBot v5.0.7b

This commit is contained in:
Parker2991
2024-04-22 19:07:29 +02:00
parent afff6aea83
commit 5000abf90d
101 changed files with 2601 additions and 1587 deletions
+6 -14
View File
@@ -1,6 +1,7 @@
const path = require('path');
const fs = require('fs');
const CommandError = require('../CommandModules/command_error')
const { EmbedBuilder } = require('discord.js')
function reload (bot,options,context) {
bot.reload = function () {
for (const filename of fs.readdirSync(path.join(__dirname, "../commands"))) {
@@ -13,20 +14,11 @@ const command = require(path.join(__dirname, "../commands", filename));
bot.commandManager.commandlist.pop(command)
bot.commandManager.commandlist.push(command)
} catch (error) {
bot.console.error(["Failed to load File", filename, ":", error])
bot.tellraw([{text:`Failed to load File ${filename} : ${error}`}]);
}
}
for (const filename of fs.readdirSync(path.join(__dirname, "../modules"))) {
try {
const module = require(path.join(__dirname, "../modules", filename));
delete require.cache[require.resolve(path.join(__dirname, "../modules", filename))]
// bot.loadModule(module)
} catch (error) {
bot.console.error("Failed to load File", filename, ":", error.toString())
bot.tellraw([{text:`Failed to load File ${filename} : ${error}`}]);
}
bot.console.error(["Failed to load File ", filename, ":", error.stack])
bot.tellraw({text:`${error.stack}`,color:'dark_red'});
}
}
}