Fixed owner override in music commands
This commit is contained in:
parent
9fd21495c9
commit
e8337c40f4
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue