mirror of
https://code.chipmunk.land/Parker2991/NitoriBot/
synced 2026-12-06 01:15:42 -05:00
FNFBoyfriendBot v5.0.7b
This commit is contained in:
+6
-14
@@ -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'});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user