diff --git a/events/client/ready.js b/events/client/ready.js index 1a4298d..cc0020c 100755 --- a/events/client/ready.js +++ b/events/client/ready.js @@ -16,7 +16,7 @@ module.exports = client => { try { let i = 0 client.guilds.cache.forEach( (guild) => { - if (!guild.me.permissions.has("ADMINISTRATOR")) { + if (!guild.members.me.permissions.has("ADMINISTRATOR")) { table.addRow(guild.name, "Missing permissions") i++ } @@ -31,7 +31,7 @@ module.exports = client => { } } else { - if (guild.me.permissions.has("CREATE_INSTANT_INVITE")) { + if (guild.members.me.permissions.has("CREATE_INSTANT_INVITE")) { let channel = guild.channels.cache.filter(channel => channel.type === "GUILD_TEXT").first() if (channel) { let invite = channel.createInvite( diff --git a/events/guild/messageCreate.js b/events/guild/messageCreate.js index 5aea9d4..eff016e 100755 --- a/events/guild/messageCreate.js +++ b/events/guild/messageCreate.js @@ -160,7 +160,7 @@ module.exports = async (client, message) => { "SPEAK" // "DEAFEN_MEMBERS", ]; - if (!message.guild.me.permissions.has(required_perms)) { + if (!message.guild.members.me.permissions.has(required_perms)) { try { message.react("❌"); } catch {} diff --git a/events/guild/voiceStateUpdate.js b/events/guild/voiceStateUpdate.js index 7a6d055..d73ddcb 100644 --- a/events/guild/voiceStateUpdate.js +++ b/events/guild/voiceStateUpdate.js @@ -71,23 +71,9 @@ module.exports = async (client, oldState, voiceState) => { connection.destroy(); }, 2000) }) - - // if (subscription) { - // // Unsubscribe after 5 seconds (stop playing audio on the voice connection) - // setTimeout(() => subscription.unsubscribe(), 5_000); - // } player.play(resource); }) - - - - // setTimeout((subscription) => { - // subscription.unsubscribe() - // if (connection.state.status != "destroyed") { - // connection.destroy(); - // } - // }, 6 * 1000) sendNinluc(client, `Je joue *${rdVideoLink.split('.')[0]}* dans le salon ${voiceState.channel} du serveur **${voiceState.guild.name}**`); } catch (error) { diff --git a/package.json b/package.json index f5b8e07..818089b 100755 --- a/package.json +++ b/package.json @@ -10,16 +10,12 @@ "author": "Tomato#6966 (author of this template), Ninluc", "license": "ISC", "dependencies": { - "@discordjs/opus": "^0.5.3", "@discordjs/voice": "^0.10.0", "ascii-table": "0.0.9", + "colors": "^1.4.0", "discord.js": "^13.8.1", "ffmpeg-static": "^4.4.1", "libsodium-wrappers": "^0.7.10", "moment": "^2.29.4" - }, - "devDependencies": { - "ascii-table": "0.0.9", - "colors": "^1.4.0" } }