Skip to content

Commit

Permalink
fix(MessageReaction*Action): correctly cache incoming members and use…
Browse files Browse the repository at this point in the history
…rs (#4969)
  • Loading branch information
SpaceEEC committed Nov 20, 2020
1 parent 7faa73a commit 8b91ac5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/client/actions/Action.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,9 @@ class GenericAction {
if (data.guild_id && data.member && data.member.user) {
const guild = this.client.guilds.cache.get(data.guild_id);
if (guild) {
const member = this.getMember(data.member, guild);
return member ? member.user : this.getUser(data.member.user);
return guild.members.add(data.member).user;
} else {
return this.client.users.add(data.member.user);
}
}
return this.getUser(data);
Expand Down
5 changes: 4 additions & 1 deletion src/client/actions/MessageReactionAdd.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ const { PartialTypes } = require('../../util/Constants');
{ user_id: 'id',
message_id: 'id',
emoji: { name: '�', id: null },
channel_id: 'id' } }
channel_id: 'id',
// If originating from a guild
guild_id: 'id',
member: { ..., user: { ... } } }
*/

class MessageReactionAdd extends Action {
Expand Down
3 changes: 2 additions & 1 deletion src/client/actions/MessageReactionRemove.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ const { Events } = require('../../util/Constants');
{ user_id: 'id',
message_id: 'id',
emoji: { name: '�', id: null },
channel_id: 'id' } }
channel_id: 'id',
guild_id: 'id' }
*/

class MessageReactionRemove extends Action {
Expand Down

0 comments on commit 8b91ac5

Please sign in to comment.