From 2b1bb07be165f107e2c6f7c403dc697b1e926c2f Mon Sep 17 00:00:00 2001 From: janderedev Date: Sun, 24 Apr 2022 14:06:02 +0200 Subject: [PATCH] i forgor --- bridge/src/discord/commands.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bridge/src/discord/commands.ts b/bridge/src/discord/commands.ts index 550701c..5d26c58 100644 --- a/bridge/src/discord/commands.ts +++ b/bridge/src/discord/commands.ts @@ -80,6 +80,9 @@ client.on('interactionCreate', async interaction => { const request = await BRIDGE_REQUESTS.findOne({ id: id }); if (!request || request.expires < Date.now()) return await interaction.reply('Unknown ID.'); + const bridgedCount = await BRIDGE_CONFIG.count({ discord: interaction.channelId }); + if (bridgedCount > 0) return await interaction.reply('This channel is already bridged.'); + const webhook = await (interaction.channel as TextChannel) .createWebhook('AutoMod Bridge', { avatar: client.user?.avatarURL() });