handleDispatch(data) {
        switch (data.t) {
            case 'PRESENCE_UPDATE':
                this.emit('presenceUpdate', data.d);
                break;
            case 'READY':
                this.sessionID = data.d.session_id;
                this.emit('ready', data.d);
                break;
            case 'RESUME':
                this.emit('resume', data.d);
                break;
            case 'MESSAGE_CREATE':
                this.emit('messageCreate', new Message(data.d, this));
                break;
            case 'MESSAGE_UPDATE':
                this.emit('messageUpdate', new Message(data.d, this));
                break;
            case 'MESSAGE_DELETE':
                this.emit('messageDelete', data.d);
                break;
            case 'MESSAGE_DELETE_BULK':
                this.emit('messageDeleteBulk', data.d);
                break;
            case 'MESSAGE_REACTION_ADD':
                this.emit('messageReactionAdd', data.d);
                break;
            case 'MESSAGE_REACTION_REMOVE':
                this.emit('messageReactionRemove', data.d);
                break;
            case 'MESSAGE_REACTION_REMOVE_ALL':
                this.emit('messageReactionRemoveAll', data.d);
                break;
            case 'CHANNEL_CREATE':
                this.emit('channelCreate', new Channel(data.d));
                break;
            case 'CHANNEL_UPDATE':
                this.emit('channelUpdate', new Channel(data.d));
                break;
            case 'CHANNEL_DELETE':
                this.emit('channelDelete', data.d);
                break;
            case 'CHANNEL_PINS_UPDATE':
                this.emit('channelPinsUpdate', data.d);
                break;
            case 'GUILD_CREATE':
                if (data.d.large) { this.getGuildMembers(data.d.id); }
                this.emit('guildCreate', new Guild(data.d));
                this.guildCount++;
                break;
            case 'GUILD_UPDATE':
                this.emit('guildUpdate', new Guild(data.d));
                break;
            case 'GUILD_DELETE':
                if (data.d.unavailable) {
                    this.emit('guildUnavailable', data.d);
                } else {
                    this.emit('guildDelete', data.d);
                    this.guildCount--;
                }
                break;
            case 'GUILD_BAN_ADD':
                this.emit('guildBanAdd', data.d);
                break;
            case 'GUILD_BAN_REMOVE':
                this.emit('guildBanRemove', data.d);
                break;
            case 'GUILD_EMOJIS_UPDATE':
                this.emit('guildEmojisUpdate', data.d);
                break;
            case 'GUILD_MEMBER_ADD':
                this.emit('guildMemberAdd', new Member(data.d, this));
                break;
            case 'GUILD_MEMBER_UPDATE':
                this.emit('guildMemberUpdate', new User(data.d, this));
                break;
            case 'GUILD_MEMBER_REMOVE':
                this.emit('guildMemberRemove', new User(data.d.user, this), data.d.guild_id);
                break;
            case 'GUILD_MEMBERS_CHUNK':
                this.emit('guildMembersChunk', data.d);
                break;
            case 'GUILD_ROLE_CREATE':
                this.emit('guildRoleCreate', data.d);
                break;
            case 'GUILD_ROLE_UPDATE':
                this.emit('guildRoleUpdate', data.d);
                break;
            case 'GUILD_ROLE_DELETE':
                this.emit('guildRoleDelete', data.d);
                break;
            case 'VOICE_STATE_UPDATE':
                this.emit('voiceStateUpdate', data.d);
                break;
            case 'VOICE_SERVER_UPDATE':
                this.emit('voiceServerUpdate', data.d);
                break;
            case 'WEBHOOK_UPDATE':
                this.emit('webhookUpdate', data.d);
                break;
            case 'TYPING_START':
                this.emit('typingStart', data.d);
                break;
            default:
                console.error('UNKNOWN EVENT: ', data);
                this.emit('unknown', data);
                break;
        }
    }
/**
     * Handle events dispatched by the websocket
     *
     * @param {Object} data data object
     * @memberof Client
     */
Handle events dispatched by the websocket
@param {Object} data data object
@memberof Client
Handle events dispatched by the websocket @param { Object } data data object @memberof Client
handleDispatch(data) {
        switch (data.t) {
            case 'PRESENCE_UPDATE':
                this.emit('presenceUpdate', data.d);
                break;
            case 'READY':
                this.sessionID = data.d.session_id;
                this.emit('ready', data.d);
                break;
            case 'RESUME':
                this.emit('resume', data.d);
                break;
            case 'MESSAGE_CREATE':
                this.emit('messageCreate', new Message(data.d, this));
                break;
            case 'MESSAGE_UPDATE':
                this.emit('messageUpdate', new Message(data.d, this));
                break;
            case 'MESSAGE_DELETE':
                this.emit('messageDelete', data.d);
                break;
            case 'MESSAGE_DELETE_BULK':
                this.emit('messageDeleteBulk', data.d);
                break;
            case 'MESSAGE_REACTION_ADD':
                this.emit('messageReactionAdd', data.d);
                break;
            case 'MESSAGE_REACTION_REMOVE':
                this.emit('messageReactionRemove', data.d);
                break;
            case 'MESSAGE_REACTION_REMOVE_ALL':
                this.emit('messageReactionRemoveAll', data.d);
                break;
            case 'CHANNEL_CREATE':
                this.emit('channelCreate', new Channel(data.d));
                break;
            case 'CHANNEL_UPDATE':
                this.emit('channelUpdate', new Channel(data.d));
                break;
            case 'CHANNEL_DELETE':
                this.emit('channelDelete', data.d);
                break;
            case 'CHANNEL_PINS_UPDATE':
                this.emit('channelPinsUpdate', data.d);
                break;
            case 'GUILD_CREATE':
                if (data.d.large) { this.getGuildMembers(data.d.id); }
                this.emit('guildCreate', new Guild(data.d));
                this.guildCount++;
                break;
            case 'GUILD_UPDATE':
                this.emit('guildUpdate', new Guild(data.d));
                break;
            case 'GUILD_DELETE':
                if (data.d.unavailable) {
                    this.emit('guildUnavailable', data.d);
                } else {
                    this.emit('guildDelete', data.d);
                    this.guildCount--;
                }
                break;
            case 'GUILD_BAN_ADD':
                this.emit('guildBanAdd', data.d);
                break;
            case 'GUILD_BAN_REMOVE':
                this.emit('guildBanRemove', data.d);
                break;
            case 'GUILD_EMOJIS_UPDATE':
                this.emit('guildEmojisUpdate', data.d);
                break;
            case 'GUILD_MEMBER_ADD':
                this.emit('guildMemberAdd', new Member(data.d, this));
                break;
            case 'GUILD_MEMBER_UPDATE':
                this.emit('guildMemberUpdate', new User(data.d, this));
                break;
            case 'GUILD_MEMBER_REMOVE':
                this.emit('guildMemberRemove', new User(data.d.user, this), data.d.guild_id);
                break;
            case 'GUILD_MEMBERS_CHUNK':
                this.emit('guildMembersChunk', data.d);
                break;
            case 'GUILD_ROLE_CREATE':
                this.emit('guildRoleCreate', data.d);
                break;
            case 'GUILD_ROLE_UPDATE':
                this.emit('guildRoleUpdate', data.d);
                break;
            case 'GUILD_ROLE_DELETE':
                this.emit('guildRoleDelete', data.d);
                break;
            case 'VOICE_STATE_UPDATE':
                this.emit('voiceStateUpdate', data.d);
                break;
            case 'VOICE_SERVER_UPDATE':
                this.emit('voiceServerUpdate', data.d);
                break;
            case 'WEBHOOK_UPDATE':
                this.emit('webhookUpdate', data.d);
                break;
            case 'TYPING_START':
                this.emit('typingStart', data.d);
                break;
            default:
                console.error('UNKNOWN EVENT: ', data);
                this.emit('unknown', data);
                break;
        }
    }
handleDispatch ( data ) { switch ( data . t ) { case 'PRESENCE_UPDATE' : this . emit ( 'presenceUpdate' , data . d ) ; break ; case 'READY' : this . sessionID = data . d . session_id ; this . emit ( 'ready' , data . d ) ; break ; case 'RESUME' : this . emit ( 'resume' , data . d ) ; break ; case 'MESSAGE_CREATE' : this . emit ( 'messageCreate' , new Message ( data . d , this ) ) ; break ; case 'MESSAGE_UPDATE' : this . emit ( 'messageUpdate' , new Message ( data . d , this ) ) ; break ; case 'MESSAGE_DELETE' : this . emit ( 'messageDelete' , data . d ) ; break ; case 'MESSAGE_DELETE_BULK' : this . emit ( 'messageDeleteBulk' , data . d ) ; break ; case 'MESSAGE_REACTION_ADD' : this . emit ( 'messageReactionAdd' , data . d ) ; break ; case 'MESSAGE_REACTION_REMOVE' : this . emit ( 'messageReactionRemove' , data . d ) ; break ; case 'MESSAGE_REACTION_REMOVE_ALL' : this . emit ( 'messageReactionRemoveAll' , data . d ) ; break ; case 'CHANNEL_CREATE' : this . emit ( 'channelCreate' , new Channel ( data . d ) ) ; break ; case 'CHANNEL_UPDATE' : this . emit ( 'channelUpdate' , new Channel ( data . d ) ) ; break ; case 'CHANNEL_DELETE' : this . emit ( 'channelDelete' , data . d ) ; break ; case 'CHANNEL_PINS_UPDATE' : this . emit ( 'channelPinsUpdate' , data . d ) ; break ; case 'GUILD_CREATE' : if ( data . d . large ) { this . getGuildMembers ( data . d . id ) ; } this . emit ( 'guildCreate' , new Guild ( data . d ) ) ; this . guildCount ++ ; break ; case 'GUILD_UPDATE' : this . emit ( 'guildUpdate' , new Guild ( data . d ) ) ; break ; case 'GUILD_DELETE' : if ( data . d . unavailable ) { this . emit ( 'guildUnavailable' , data . d ) ; } else { this . emit ( 'guildDelete' , data . d ) ; this . guildCount -- ; } break ; case 'GUILD_BAN_ADD' : this . emit ( 'guildBanAdd' , data . d ) ; break ; case 'GUILD_BAN_REMOVE' : this . emit ( 'guildBanRemove' , data . d ) ; break ; case 'GUILD_EMOJIS_UPDATE' : this . emit ( 'guildEmojisUpdate' , data . d ) ; break ; case 'GUILD_MEMBER_ADD' : this . emit ( 'guildMemberAdd' , new Member ( data . d , this ) ) ; break ; case 'GUILD_MEMBER_UPDATE' : this . emit ( 'guildMemberUpdate' , new User ( data . d , this ) ) ; break ; case 'GUILD_MEMBER_REMOVE' : this . emit ( 'guildMemberRemove' , new User ( data . d . user , this ) , data . d . guild_id ) ; break ; case 'GUILD_MEMBERS_CHUNK' : this . emit ( 'guildMembersChunk' , data . d ) ; break ; case 'GUILD_ROLE_CREATE' : this . emit ( 'guildRoleCreate' , data . d ) ; break ; case 'GUILD_ROLE_UPDATE' : this . emit ( 'guildRoleUpdate' , data . d ) ; break ; case 'GUILD_ROLE_DELETE' : this . emit ( 'guildRoleDelete' , data . d ) ; break ; case 'VOICE_STATE_UPDATE' : this . emit ( 'voiceStateUpdate' , data . d ) ; break ; case 'VOICE_SERVER_UPDATE' : this . emit ( 'voiceServerUpdate' , data . d ) ; break ; case 'WEBHOOK_UPDATE' : this . emit ( 'webhookUpdate' , data . d ) ; break ; case 'TYPING_START' : this . emit ( 'typingStart' , data . d ) ; break ; default : console . error ( 'UNKNOWN EVENT: ' , data ) ; this . emit ( 'unknown' , data ) ; break ; } }
Handle events dispatched by the websocket
 @param {Object} data data object
 @memberof Client
Handle events dispatched by the websocket @param { Object } data data object @memberof Client