Skip to content

Commit 719e54a

Browse files
Jiralitekodiakhq[bot]
andauthoredJul 9, 2023
fix(Action): Use existing recipients if available (#9653)
* fix(Action): use existing recipients if available * fix: account for message delete -> interaction * fix(Action): use `last_message_id` if it exists * refactor(Action): use ternary --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
1 parent ede9f4e commit 719e54a

File tree

1 file changed

+3
-6
lines changed
  • packages/discord.js/src/client/actions

1 file changed

+3
-6
lines changed
 

‎packages/discord.js/src/client/actions/Action.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,7 @@ class GenericAction {
2424
}
2525

2626
getPayload(data, manager, id, partialType, cache) {
27-
const existing = manager.cache.get(id);
28-
if (!existing && this.client.options.partials.includes(partialType)) {
29-
return manager._add(data, cache);
30-
}
31-
return existing;
27+
return this.client.options.partials.includes(partialType) ? manager._add(data, cache) : manager.cache.get(id);
3228
}
3329

3430
getChannel(data) {
@@ -39,7 +35,8 @@ class GenericAction {
3935
{
4036
id,
4137
guild_id: data.guild_id,
42-
recipients: [data.author ?? data.user ?? { id: data.user_id }],
38+
recipients: data.recipients ?? [data.author ?? data.user ?? { id: data.user_id }],
39+
last_message_id: data.last_message_id,
4340
},
4441
this.client.channels,
4542
id,

0 commit comments

Comments
 (0)
Please sign in to comment.