Skip to content

Commit

Permalink
fix(ClientUser): correctly resolve nicks to an object in createGroupDM
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaceEEC committed May 25, 2018
1 parent f456f4c commit f23b617
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/structures/ClientUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,10 @@ class ClientUser extends User {
return this.client.rest.methods.createGroupDM({
recipients: recipients.map(u => this.client.resolver.resolveUserID(u.user)),
accessTokens: recipients.map(u => u.accessToken),
nicks: recipients.map(u => u.nick),
nicks: recipients.reduce((o, r) => {
if (r.nick) o[r.user ? r.user.id : r.id] = r.nick;
return o;
}, {}),
});
}

Expand Down

0 comments on commit f23b617

Please # to comment.