From f23b61794c8bce64bfc63fb2bcd82849c5416bbe Mon Sep 17 00:00:00 2001 From: SpaceEEC Date: Fri, 25 May 2018 17:23:09 +0200 Subject: [PATCH] fix(ClientUser): correctly resolve nicks to an object in createGroupDM --- src/structures/ClientUser.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/structures/ClientUser.js b/src/structures/ClientUser.js index 064eb23d3..37bef239b 100644 --- a/src/structures/ClientUser.js +++ b/src/structures/ClientUser.js @@ -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; + }, {}), }); }