From 691fd8c9bd26825df6025cd84db554f8ff21449c Mon Sep 17 00:00:00 2001 From: Rob Taylor Date: Thu, 17 Jun 2021 12:45:09 +0100 Subject: [PATCH] Replacing GET with FIND. To possibly improve stability of user searches. --- web.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/web.js b/web.js index 080ea45..5f335b8 100644 --- a/web.js +++ b/web.js @@ -44,10 +44,10 @@ client.login(DISCORD_TOKEN); client.on('ready', () => { log('Bot is ready to mute them all! :)'); - discordGuild = client.guilds.get(DISCORD_GUILD); - // guild = client.guilds.find('id', DISCORD_GUILD); - discordChannel = discordGuild.channels.get(DISCORD_CHANNEL); - // channel = guild.channels.find('id', DISCORD_CHANNEL); + // discordGuild = client.guilds.get(DISCORD_GUILD); + discordGuild = client.guilds.find('id', DISCORD_GUILD); + // discordChannel = discordGuild.channels.get(DISCORD_CHANNEL); + discordChannel = guild.channels.find('id', DISCORD_CHANNEL); }); client.on('voiceStateUpdate', (oldMember, newMember) => { //player leaves the ttt-channel if (oldMember.voiceChannel != newMember.voiceChannel && isMemberInVoiceChannel(oldMember)) { @@ -124,8 +124,8 @@ requests['mute'] = (params, ret) => { params ); - //let member = discordGuild.members.find(user => user.id === id); - let member = discordGuild.members.get(id); + let member = discordGuild.members.find(user => user.id === id); +// let member = discordGuild.members.get(id); if (member) { if (isMemberInVoiceChannel(member)) { if (!member.serverMute && mute) {