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>
This commit is contained in:
DD
2024-04-28 01:37:16 +03:00
committed by GitHub
parent 14f9ff7412
commit 798f28cb9b

View File

@@ -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;
/**