From 8a75d30afa249fd774930734008eb10815fbbdac Mon Sep 17 00:00:00 2001 From: Lamp Date: Wed, 11 Sep 2019 06:52:48 +0000 Subject: [PATCH] hhhhhhhhh --- src/mppbridger/commands/bridge.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mppbridger/commands/bridge.js b/src/mppbridger/commands/bridge.js index 92fd974..d18c816 100644 --- a/src/mppbridger/commands/bridge.js +++ b/src/mppbridger/commands/bridge.js @@ -9,7 +9,7 @@ module.exports = { var site = 'MPP'; var room = msg.txt(1); if (!room) return "EBADUSG"; - var existingBridge = (await dbClient.query('SELECT * FROM bridges WHERE mpp_room = $1;', [room])).rows[0]; + var existingBridge = (await dbClient.query("SELECT * FROM bridges WHERE mpp_room = $1 AND site = 'MPP';", [room])).rows[0]; if (existingBridge) { if (!existingBridge.disabled) { return msg.reply(`${site} room ${room} is already bridged.`); @@ -18,7 +18,7 @@ module.exports = { return msg.reply(`You cannot bridge this room.`); } else /* rebridge */ { 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 dbClient.query("UPDATE bridges SET disabled = false WHERE mpp_room = $1 AND site = 'MPP'", [room]); await channel.setParent(config.channels.mpp_bridges); await new Promise(resolve => setTimeout(resolve, 500)); await channel.lockPermissions();