mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-16 19:43:29 +01:00
Merge branch 'master' into voice-rewrite
This commit is contained in:
@@ -269,13 +269,15 @@ class WebSocketConnection extends EventEmitter {
|
|||||||
|
|
||||||
this.inflate.push(data, flush && zlib.Z_SYNC_FLUSH);
|
this.inflate.push(data, flush && zlib.Z_SYNC_FLUSH);
|
||||||
if (!flush) return;
|
if (!flush) return;
|
||||||
|
let packet;
|
||||||
try {
|
try {
|
||||||
const packet = WebSocket.unpack(this.inflate.result);
|
packet = WebSocket.unpack(this.inflate.result);
|
||||||
this.onPacket(packet);
|
|
||||||
if (this.client.listenerCount('raw')) this.client.emit('raw', packet);
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.client.emit('debug', err);
|
this.client.emit('debug', err);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
this.onPacket(packet);
|
||||||
|
if (this.client.listenerCount('raw')) this.client.emit('raw', packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ const lruable = ['group', 'dm'];
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Stores channels.
|
* Stores channels.
|
||||||
* @private
|
|
||||||
* @extends {DataStore}
|
* @extends {DataStore}
|
||||||
*/
|
*/
|
||||||
class ChannelStore extends DataStore {
|
class ChannelStore extends DataStore {
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ const { TypeError } = require('../errors');
|
|||||||
/**
|
/**
|
||||||
* Stores the client presence and other presences.
|
* Stores the client presence and other presences.
|
||||||
* @extends {PresenceStore}
|
* @extends {PresenceStore}
|
||||||
* @private
|
|
||||||
*/
|
*/
|
||||||
class ClientPresenceStore extends PresenceStore {
|
class ClientPresenceStore extends PresenceStore {
|
||||||
constructor(...args) {
|
constructor(...args) {
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ const Permissions = require('../util/Permissions');
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Stores guild channels.
|
* Stores guild channels.
|
||||||
* @private
|
|
||||||
* @extends {DataStore}
|
* @extends {DataStore}
|
||||||
*/
|
*/
|
||||||
class GuildChannelStore extends DataStore {
|
class GuildChannelStore extends DataStore {
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ const DataResolver = require('../util/DataResolver');
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Stores guild emojis.
|
* Stores guild emojis.
|
||||||
* @private
|
|
||||||
* @extends {DataStore}
|
* @extends {DataStore}
|
||||||
*/
|
*/
|
||||||
class GuildEmojiStore extends DataStore {
|
class GuildEmojiStore extends DataStore {
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ const Guild = require('../structures/Guild');
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Stores guilds.
|
* Stores guilds.
|
||||||
* @private
|
|
||||||
* @extends {DataStore}
|
* @extends {DataStore}
|
||||||
*/
|
*/
|
||||||
class GuildStore extends DataStore {
|
class GuildStore extends DataStore {
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ const { Presence } = require('../structures/Presence');
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Stores presences.
|
* Stores presences.
|
||||||
* @private
|
|
||||||
* @extends {DataStore}
|
* @extends {DataStore}
|
||||||
*/
|
*/
|
||||||
class PresenceStore extends DataStore {
|
class PresenceStore extends DataStore {
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ const MessageReaction = require('../structures/MessageReaction');
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Stores reactions.
|
* Stores reactions.
|
||||||
* @private
|
|
||||||
* @extends {DataStore}
|
* @extends {DataStore}
|
||||||
*/
|
*/
|
||||||
class ReactionStore extends DataStore {
|
class ReactionStore extends DataStore {
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ const Permissions = require('../util/Permissions');
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Stores roles.
|
* Stores roles.
|
||||||
* @private
|
|
||||||
* @extends {DataStore}
|
* @extends {DataStore}
|
||||||
*/
|
*/
|
||||||
class RoleStore extends DataStore {
|
class RoleStore extends DataStore {
|
||||||
|
|||||||
@@ -357,7 +357,8 @@ class GuildMember extends Base {
|
|||||||
const clone = this._clone();
|
const clone = this._clone();
|
||||||
data.user = this.user;
|
data.user = this.user;
|
||||||
clone._patch(data);
|
clone._patch(data);
|
||||||
clone._frozenVoiceState = this.voiceState;
|
clone._frozenVoiceState = {};
|
||||||
|
Object.assign(clone._frozenVoiceState, this.voiceState);
|
||||||
if (typeof data.mute !== 'undefined') clone._frozenVoiceState.mute = data.mute;
|
if (typeof data.mute !== 'undefined') clone._frozenVoiceState.mute = data.mute;
|
||||||
if (typeof data.deaf !== 'undefined') clone._frozenVoiceState.mute = data.deaf;
|
if (typeof data.deaf !== 'undefined') clone._frozenVoiceState.mute = data.deaf;
|
||||||
if (typeof data.channel_id !== 'undefined') clone._frozenVoiceState.channel_id = data.channel_id;
|
if (typeof data.channel_id !== 'undefined') clone._frozenVoiceState.channel_id = data.channel_id;
|
||||||
|
|||||||
Reference in New Issue
Block a user