Skip to content

Commit

Permalink
fix: message update should only run when diff in content
Browse files Browse the repository at this point in the history
  • Loading branch information
Muril-o authored and Muril-o committed Jan 26, 2023
1 parent 0be7ca7 commit fa9baf3
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 fa9baf3

Please sign in to comment.