add clientuser#friends (#807)

* add client#friends

* Update Ready.js

* Update Client.js

* move friends to client.user

* Update ClientUser.js

* Update ClientUser.js
This commit is contained in:
Gus Caplan
2016-10-16 20:28:17 -05:00
committed by Schuyler Cebulskie
parent fc307fab8a
commit e04dbbdb82
3 changed files with 14 additions and 1 deletions

View File

@@ -16,6 +16,11 @@ class ReadyHandler extends AbstractHandler {
for (const guild of data.guilds) client.dataManager.newGuild(guild);
for (const privateDM of data.private_channels) client.dataManager.newChannel(privateDM);
for (const relation of data.relationships) {
const friend = client.dataManager.newUser(relation.user);
client.user.friends.set(friend.id, friend);
}
data.presences = data.presences || [];
for (const presence of data.presences) {
client.dataManager.newUser(presence.user);