Skip to content

Commit

Permalink
fix(actions): always emit message create for own messages (#10211)
Browse files Browse the repository at this point in the history
* fix(actions): always emit message create for own messages

* fix: don't re-cache

* fix: user can be missing

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
didinele and kodiakhq[bot] committed Apr 27, 2024
1 parent 14f9ff7 commit 798f28c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/discord.js/src/client/actions/MessageCreate.js
Expand Up @@ -16,8 +16,8 @@ class MessageCreateAction extends Action {
}

const existing = channel.messages.cache.get(data.id);
if (existing) return { message: existing };
const message = channel.messages._add(data);
if (existing && existing.author?.id !== this.client.user.id) return { message: existing };
const message = existing ?? channel.messages._add(data);
channel.lastMessageId = data.id;

/**
Expand Down

0 comments on commit 798f28c

Please sign in to comment.