From e8337c40f41f2492bb694e4005ebfbf007429139 Mon Sep 17 00:00:00 2001 From: Essem Date: Fri, 26 Aug 2022 20:55:24 -0500 Subject: [PATCH] Fixed owner override in music commands --- commands/music/host.js | 2 +- commands/music/remove.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/music/host.js b/commands/music/host.js index c638ac1..99d9b92 100644 --- a/commands/music/host.js +++ b/commands/music/host.js @@ -6,7 +6,7 @@ class HostCommand extends MusicCommand { if (!this.channel.guild) return "This command only works in servers!"; if (!this.member.voiceState.channelID) return "You need to be in a voice channel first!"; if (!this.channel.guild.members.get(this.client.user.id).voiceState.channelID) return "I'm not in a voice channel!"; - if (this.connection.host !== this.author.id && this.author.id !== process.env.OWNER) return "Only the current voice session host can choose another host!"; + if (this.connection.host !== this.author.id && !process.env.OWNER.split(",").includes(this.connection.host)) return "Only the current voice session host can choose another host!"; const input = this.options.user ?? this.args.join(" "); if (!input || !input.trim()) return "You need to provide who you want the host to be!"; let user; diff --git a/commands/music/remove.js b/commands/music/remove.js index c0174e5..a9904de 100644 --- a/commands/music/remove.js +++ b/commands/music/remove.js @@ -6,7 +6,7 @@ class RemoveCommand extends MusicCommand { if (!this.channel.guild) return "This command only works in servers!"; if (!this.member.voiceState.channelID) return "You need to be in a voice channel first!"; if (!this.channel.guild.members.get(this.client.user.id).voiceState.channelID) return "I'm not in a voice channel!"; - if (this.connection.host !== this.author.id) return "Only the current voice session host can remove songs from the queue!"; + if (this.connection.host !== this.author.id && !process.env.OWNER.split(",").includes(this.connection.host)) return "Only the current voice session host can remove songs from the queue!"; const pos = parseInt(this.options.position ?? this.args[0]); if (isNaN(pos) || pos > this.queue.length || pos < 1) return "That's not a valid position!"; const removed = this.queue.splice(pos, 1);