Skip to content

Commit

Permalink
Merge pull request #3 from edgedb/remove-integrations-messages
Browse files Browse the repository at this point in the history
Don't save bots msgs to DB
  • Loading branch information
diksipav authored Oct 3, 2024
2 parents 4dfc32a + fffa150 commit bf94235
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/lib/discord/commands/helpful.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<APIChatInputApplicationCommandInteractionData>
{
Expand Down Expand Up @@ -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, {
Expand Down

0 comments on commit bf94235

Please sign in to comment.