Skip to content

Commit

Permalink
Merge pull request #14 from Muril-o/fix-message-update
Browse files Browse the repository at this point in the history
fix: message update should only run when diff in content
  • Loading branch information
Yakiyo authored Jan 26, 2023
2 parents f594989 + fa9baf3 commit 7b5473d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/events/messageUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@ export const event: Event = {
once: false,
async handle(oldMessage: Message, newMessage: Message) {
// We dont listen to edits in interaction responses or dm messages
if (newMessage.interaction || !newMessage.inGuild() || newMessage.author.bot) return;
// Additionally we don't listen to messages with same content
if (
newMessage.interaction ||
!newMessage.inGuild() ||
newMessage.author.bot ||
oldMessage.content === newMessage.content
)
return;

if (oldMessage.partial) {
try {
Expand Down

0 comments on commit 7b5473d

Please sign in to comment.