Skip to content

Commit 798f28c

Browse files
fix(actions): always emit message create for own messages (#10211)
* 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>
1 parent 14f9ff7 commit 798f28c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/discord.js/src/client/actions/MessageCreate.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ class MessageCreateAction extends Action {
1616
}
1717

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

2323
/**

0 commit comments

Comments
 (0)