Skip to content

Commit

Permalink
Discriminator support for userUpdate event (fix #353) (#354)
Browse files Browse the repository at this point in the history
* Add support for discriminator-only changes in presence_update
  • Loading branch information
DasWolke authored and abalabahaha committed Jan 25, 2018
1 parent 43e869d commit 8e11525
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/gateway/Shard.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ class Shard extends EventEmitter {
if(packet.d.user.username !== undefined) {
var user = this.client.users.get(packet.d.user.id);
var oldUser = null;
if(user && (user.username !== packet.d.user.username || user.avatar !== packet.d.user.avatar)) {
if(user && (user.username !== packet.d.user.username || user.avatar !== packet.d.user.avatar || user.discriminator !== packet.d.user.discriminator)) {
oldUser = {
username: user.username,
discriminator: user.discriminator,
Expand All @@ -223,7 +223,7 @@ class Shard extends EventEmitter {
if(!user || oldUser) {
user = this.client.users.update(packet.d.user, this.client);
/**
* Fired when a user's username or avatar changes
* Fired when a user's username, avatar, or discriminator changes
* @event Client#userUpdate
* @prop {User} user The updated user
* @prop {Object?} oldUser The old user data
Expand Down

0 comments on commit 8e11525

Please sign in to comment.