From cf33158b4347f8c6d55b8f3f6f93584d83a0d7b1 Mon Sep 17 00:00:00 2001 From: Lamp Date: Sat, 1 Sep 2018 13:21:34 -0700 Subject: [PATCH] Attempt work-around lockPermissions() malfunction --- src/commands.js | 1 + src/mppbridger/commands/bridge.js | 1 + src/mppbridger/commands/unbridge.js | 1 + 3 files changed, 3 insertions(+) diff --git a/src/commands.js b/src/commands.js index 75b36ba..8bcc3b6 100755 --- a/src/commands.js +++ b/src/commands.js @@ -80,6 +80,7 @@ global.commands = { } if (!channel.permissionsFor(msg.member).has('MANAGE_CHANNELS')) return msg.react('🚫'); await channel.setParent(config.channels.deleted_channels); + await new Promise(resolve => setTimeout(resolve, 500)); await channel.lockPermissions(); msg.react('🆗'); } diff --git a/src/mppbridger/commands/bridge.js b/src/mppbridger/commands/bridge.js index 66b32f7..d6da392 100644 --- a/src/mppbridger/commands/bridge.js +++ b/src/mppbridger/commands/bridge.js @@ -16,6 +16,7 @@ module.exports = { let channel = dClient.guilds.get(config.guildID).channels.get(existingBridge.discord_channel_id); await dbClient.query("UPDATE bridges SET disabled = false WHERE mpp_room = $1", [room]); await channel.setParent(config.channels.mpp_bridges); + await new Promise(resolve => setTimeout(resolve, 500)); await channel.lockPermissions(); let existingClient = clients.MPP[room]; if (existingClient) existingClient.start(); diff --git a/src/mppbridger/commands/unbridge.js b/src/mppbridger/commands/unbridge.js index dbb2a30..74d6661 100644 --- a/src/mppbridger/commands/unbridge.js +++ b/src/mppbridger/commands/unbridge.js @@ -22,6 +22,7 @@ module.exports = { if (client) client.stop(); var channel = dClient.channels.get(bridge.discord_channel_id) await channel.setParent(config.channels.deleted_bridges); + await new Promise(resolve => setTimeout(resolve, 500)); await channel.lockPermissions(); msg.reply(`${bridge.mpp_room} has been unbridged.`); }