From cbdb8a5be394e8cf70ceda0a458d911345975b5e Mon Sep 17 00:00:00 2001 From: Rob Taylor Date: Wed, 27 Jan 2021 09:09:13 +0000 Subject: [PATCH 1/4] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index da76722..5804790 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ }, "scripts": { "start": "node .", - "test": "echo \"Error: no test specified\" && exit 1" + "test": "echo 'Error: no test specified' && exit 1" }, "repository": { "type": "git", From c08e17f0879441e8813c510cd85cf9e4e970025e Mon Sep 17 00:00:00 2001 From: Rob Taylor Date: Thu, 28 Jan 2021 22:13:17 +0000 Subject: [PATCH 2/4] Delete config.json.example --- config.json.example | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 config.json.example diff --git a/config.json.example b/config.json.example deleted file mode 100644 index c8bbee2..0000000 --- a/config.json.example +++ /dev/null @@ -1,10 +0,0 @@ -{ - "discord": { - "token": "", - "guild": "", - "channel": "" - }, - "server": { - "port": "37405" - } -} From 691fd8c9bd26825df6025cd84db554f8ff21449c Mon Sep 17 00:00:00 2001 From: Rob Taylor Date: Thu, 17 Jun 2021 12:45:09 +0100 Subject: [PATCH 3/4] 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) { From 929f544c9c14dbffd43d39bdd9c8e86cd80c2d4a Mon Sep 17 00:00:00 2001 From: Rob Taylor Date: Thu, 17 Jun 2021 12:47:47 +0100 Subject: [PATCH 4/4] Reverting GUILD/CHANNEL find change. --- web.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web.js b/web.js index 5f335b8..5793e87 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); - discordGuild = client.guilds.find('id', DISCORD_GUILD); - // discordChannel = discordGuild.channels.get(DISCORD_CHANNEL); - discordChannel = 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)) {