Fix some permission checks, fix avatar URLs

This commit is contained in:
Essem 2022-09-23 23:50:59 -05:00
parent 888f2f8b4a
commit 49a60bba96
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C
11 changed files with 22 additions and 19 deletions

View file

@ -10,7 +10,7 @@ class AwaitRejoin extends EventEmitter {
this.channel = channel;
this.rejoined = false;
this.ended = false;
this.bot = channel.guild ? channel.guild.shard._client : channel._client;
this.bot = channel.client;
this.listener = (member, newChannel) => this.verify(member, newChannel);
this.bot.on("voiceChannelJoin", this.listener);
this.bot.on("voiceChannelSwitch", this.listener);

View file

@ -63,9 +63,9 @@ export async function play(client, sound, options, music = false) {
if (!manager) return { content: "The sound commands are still starting up!", flags: 64 };
if (!options.channel.guild) return { content: "This command only works in servers!", flags: 64 };
if (!options.member.voiceState.channelID) return { content: "You need to be in a voice channel first!", flags: 64 };
if (!options.channel.guild.permissionsOf(client.user.id).has("voiceConnect")) return { content: "I can't join this voice channel!", flags: 64 };
if (!options.channel.guild.permissionsOf(client.user.id.toString()).has("CONNECT")) return { content: "I can't join this voice channel!", flags: 64 };
const voiceChannel = options.channel.guild.channels.get(options.member.voiceState.channelID);
if (!voiceChannel.permissionsOf(client.user.id).has("voiceConnect")) return { content: "I don't have permission to join this voice channel!", flags: 64 };
if (!voiceChannel.permissionsOf(client.user.id.toString()).has("CONNECT")) return { content: "I don't have permission to join this voice channel!", flags: 64 };
if (!music && manager.players.has(options.channel.guildID)) return { content: "I can't play a sound effect while other audio is playing!", flags: 64 };
let node = manager.getNode();
if (!node) {
@ -132,7 +132,7 @@ export async function nextSong(client, options, connection, track, info, music,
color: 16711680,
author: {
name: "Now Playing",
iconURL: client.user.avatarURL
iconURL: client.user.avatarURL()
},
fields: [{
name: " Title",