mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 02:23:31 +01:00
Changing the clients username will trigger a userupdate
This commit is contained in:
5
index.js
5
index.js
@@ -535,8 +535,9 @@ exports.Client.prototype.connectWebsocket = function( cb ) {
|
||||
} else if ( dat.t === "USER_UPDATE" ) {
|
||||
|
||||
if ( dat.d.id === self.user.id ) {
|
||||
self.user.username = dat.d.username;
|
||||
self.user.avatar = dat.d.avatar;
|
||||
var newUsr = new User(dat.d);
|
||||
self.triggerEvent("userupdate", [self.user, newUsr]);
|
||||
self.user = newUsr;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user