mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-19 13:03:31 +01:00
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:
@@ -16,8 +16,8 @@ class MessageCreateAction extends Action {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const existing = channel.messages.cache.get(data.id);
|
const existing = channel.messages.cache.get(data.id);
|
||||||
if (existing) return { message: existing };
|
if (existing && existing.author?.id !== this.client.user.id) return { message: existing };
|
||||||
const message = channel.messages._add(data);
|
const message = existing ?? channel.messages._add(data);
|
||||||
channel.lastMessageId = data.id;
|
channel.lastMessageId = data.id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user