Some fixes

This commit is contained in:
Essem 2021-07-06 07:53:09 -05:00
parent 97050f0cf1
commit a91720c598
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C
4 changed files with 5 additions and 5 deletions

View file

@ -3,7 +3,7 @@ const soundPlayer = require("../utils/soundplayer.js");
class MusicCommand extends Command {
constructor(client, cluster, worker, ipc, message, args, content, specialArgs) {
super(client, cluster, ipc, message, args, content, specialArgs);
super(client, cluster, worker, ipc, message, args, content, specialArgs);
this.connection = soundPlayer.players.get(message.channel.guild.id);
}

View file

@ -6,7 +6,7 @@ class ReloadCommand extends Command {
return new Promise((resolve) => {
if (this.message.author.id !== process.env.OWNER) resolve("Only the bot owner can reload commands!");
if (this.args.length === 0) resolve("You need to provide a command to reload!");
this.ipc.broadcast("reload", { cmd: this.args[0] });
this.ipc.broadcast("reload", this.args[0]);
this.ipc.register("reloadSuccess", () => {
this.ipc.unregister("reloadSuccess");
this.ipc.unregister("reloadFail");

View file

@ -10,7 +10,7 @@ class SoundReloadCommand extends Command {
this.ipc.register("soundReloadSuccess", (msg) => {
this.ipc.unregister("soundReloadSuccess");
this.ipc.unregister("soundReloadFail");
resolve(`Successfully connected to ${msg.length} Lavalink node(s).`);
resolve(`Successfully connected to ${msg.msg.length} Lavalink node(s).`);
});
this.ipc.register("soundReloadFail", () => {
this.ipc.unregister("soundReloadSuccess");

View file

@ -60,9 +60,9 @@ class Shard extends BaseClusterWorker {
}
this.ipc.register("reload", async (message) => {
const result = await handler.unload(message.cmd);
const result = await handler.unload(message.msg);
if (result) return this.ipc.broadcast("reloadFail", { result: result });
const result2 = await handler.load(collections.paths.get(message.cmd));
const result2 = await handler.load(collections.paths.get(message.msg));
if (result2) return this.ipc.broadcast("reloadFail", { result: result2 });
return this.ipc.broadcast("reloadSuccess");
});