debug button/menu interactions

This commit is contained in:
SowinskiBraeden committed 2022-08-29 21:26:22 -07:00
1 parent eebda1c209
commit 70d3858baf
12 files changed
+844 -834

No files matched your search

+8 -7
View File
@@ -94,15 +94,15 @@ class QuarksBot extends Client {
LoadCommands() {
let CommandsDir = path.join(__dirname, '..', 'commands');
fs.readdir(CommandsDir, (err, files) => {
if (err) this.log(err);
if (err) this.error(err);
else
files.forEach((file) => {
let cmd = require(CommandsDir + "/" + file);
if (!cmd.name || !cmd.description)
return this.log(
if (!this.exists(cmd.name) || !this.exists(cmd.description))
return this.error(
"Unable to load Command: " +
file.split(".")[0] +
", Reason: File doesn't had run/name/desciption"
", Reason: File doesn't had name/desciption"
);
this.commands.set(file.split(".")[0].toLowerCase(), cmd);
this.log("Command Loaded: " + file.split(".")[0]);
@@ -113,11 +113,12 @@ class QuarksBot extends Client {
LoadEvents() {
let EventsDir = path.join(__dirname, '..', 'events');
fs.readdir(EventsDir, (err, files) => {
if (err) this.log(err);
if (err) this.error(err);
else
files.forEach((file) => {
const event = require(EventsDir + "/" + file);
this.on(file.split(".")[0], event.bind(null, this));
const event = require(EventsDir + "/" + file);;
if (file.split(".")[0] == 'interactionCreate') this.on(file.split(".")[0], i => event(this, i));
else this.on(file.split(".")[0], event.bind(null, this));
this.logger.log("Event Loaded: " + file.split(".")[0]);
});
});