Skip to content

Commit

Permalink
fix(Message): reacting returning undefined (#10475)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladfrangu committed Sep 2, 2024
1 parent 4810f7c commit 9257a09
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions packages/discord.js/src/client/actions/Action.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ class GenericAction {
getThreadMember(id, manager) {
return this.getPayload({ user_id: id }, manager, id, Partials.ThreadMember, false);
}

spreadInjectedData(data) {
return Object.fromEntries(Object.getOwnPropertySymbols(data).map(symbol => [symbol, data[symbol]]));
}
}

module.exports = GenericAction;
8 changes: 7 additions & 1 deletion packages/discord.js/src/client/actions/MessageReactionAdd.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ class MessageReactionAdd extends Action {
if (!user) return false;

// Verify channel
const channel = this.getChannel({ id: data.channel_id, guild_id: data.guild_id, user_id: data.user_id });
const channel = this.getChannel({
id: data.channel_id,
guild_id: data.guild_id,
user_id: data.user_id,
...this.spreadInjectedData(data),
});

if (!channel?.isTextBased()) return false;

// Verify message
Expand Down

0 comments on commit 9257a09

Please sign in to comment.