Skip to content

Commit

Permalink
Replacing GET with FIND.
Browse files Browse the repository at this point in the history
To possibly improve stability of user searches.
  • Loading branch information
manix84 authored Jun 17, 2021
1 parent c08e17f commit 691fd8c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions web.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 691fd8c

Please sign in to comment.