Skip to content

Commit

Permalink
fix: prevent logging related to messages authored by the bot
Browse files Browse the repository at this point in the history
This includes the two trivial events: message deletion and message update.
  • Loading branch information
2colours committed Sep 23, 2024
1 parent 3355e02 commit aa3ada4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions source/library/stores/journalling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,12 @@ class JournallingStore {
return;
}

const resolvedMessage = this.#client.entities.messages.latest.get(payload.id);

if (resolvedMessage?.author.id === this.#client.bot.id) {
return;
}

await this.tryLog("messageDelete", { guildId, args: [payload, message] });
}

Expand All @@ -197,6 +203,10 @@ class JournallingStore {
return;
}

if (message.author.id === this.#client.bot.id) {
return;
}

await this.tryLog("messageUpdate", { guildId, args: [message] });
}

Expand Down

0 comments on commit aa3ada4

Please sign in to comment.