From b13474fb7aee5bafd051c63655000063b3ab0c89 Mon Sep 17 00:00:00 2001 From: GramingFoxTeam Date: Mon, 31 Jul 2023 20:13:15 +0300 Subject: [PATCH] fix(bot-discord): fix conflicting variables --- apps/bot-discord/src/utils/reportToLogs.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/bot-discord/src/utils/reportToLogs.js b/apps/bot-discord/src/utils/reportToLogs.js index 18db8f0..99a1b7e 100644 --- a/apps/bot-discord/src/utils/reportToLogs.js +++ b/apps/bot-discord/src/utils/reportToLogs.js @@ -1,6 +1,6 @@ import { EmbedBuilder, messageLink } from 'discord.js'; -export default async function reportToLogs(config, client, action, message, { reason, expire, actionTo, actionBy }, channel) { +export default async function reportToLogs(config, client, action, message, { reason, expire, actionTo, actionBy }, msgChannel) { const channel = await client.channels.fetch(config.logs.channelId); const thread = await channel.threads.fetch(config.logs.threadId); @@ -28,8 +28,8 @@ export default async function reportToLogs(config, client, action, message, { re actionEmbed.setFields(fields); - if (channel) { - const msg = await channel.send({ embeds: [actionEmbed] }); + if (msgChannel) { + const msg = await msgChannel.send({ embeds: [actionEmbed] }); reportToLogs(config, client, action, msg, { reason, expire, actionTo, actionBy }); } else thread.send({ embeds: [actionEmbed] }); } \ No newline at end of file