From fffa15057dcb90a87e0f476bc632a11fe506669d Mon Sep 17 00:00:00 2001 From: Dijana Pavlovic Date: Thu, 3 Oct 2024 15:40:57 +0200 Subject: [PATCH] Don't save bots msgs to DB --- app/lib/discord/commands/helpful.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/lib/discord/commands/helpful.ts b/app/lib/discord/commands/helpful.ts index 105672b..b7e74b6 100644 --- a/app/lib/discord/commands/helpful.ts +++ b/app/lib/discord/commands/helpful.ts @@ -18,6 +18,9 @@ import { suggestThread } from "../queries/suggestThread.query"; import createReviewCard from "../utils/reviewCard"; import { addReviewCard } from "../queries/addReviewCard.query"; +// Ignore Needle and EdgeDB Bot messages +const userIdsToIgnore = ["878399831238909952", "1140618393154756639"]; + export default class HelpfulCommand implements Command { @@ -117,12 +120,13 @@ export default class HelpfulCommand } const threadSuggestion = await suggestThread(bot.edgedb, { - messages: messages, + messages: messages?.filter( + (msg) => !userIdsToIgnore.includes(msg.author.id) + ), suggestorId: interaction.member.user.id, suggestorName: interaction.member.user.username, threadId: threadChannel.id, }); - const reviewCard = await createReviewCard(bot, threadSuggestion); await addReviewCard(bot.edgedb, {