Fixed owner override in music commands

This commit is contained in:
Essem 2022-08-26 20:55:24 -05:00
parent 9fd21495c9
commit e8337c40f4
No known key found for this signature in database
GPG Key ID: 7D497397CC3A2A8C
2 changed files with 2 additions and 2 deletions

View File

@ -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;

View File

@ -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);