chore(deps): bump @discordjs/voice

This commit is contained in:
Cinnamon
2022-06-26 09:40:04 +07:00
parent e45169780f
commit ebfe2886ff
5 changed files with 867 additions and 4569 deletions

View File

@@ -63,30 +63,28 @@ module.exports = (client, { d: data }, shard) => {
/* eslint-disable */
VoiceConnection.prototype.configureNetworking = function () {
const { server, state } = this.packets;
if (!server || !state || this.state.status === VoiceConnectionStatus.Destroyed || !server.endpoint) return;
const networking = new Networking(
{
endpoint: server.endpoint,
serverId: server.guild_id ?? server.channel_id,
token: server.token,
sessionId: state.session_id,
userId: state.user_id,
},
Boolean(this.debug),
);
networking.once('close', this.onNetworkingClose);
networking.on('stateChange', this.onNetworkingStateChange);
networking.on('error', this.onNetworkingError);
networking.on('debug', this.onNetworkingDebug);
if (!server || !state || this.state.status === VoiceConnectionStatus.Destroyed /* Destroyed */ || !server.endpoint)
return;
const networking = new Networking({
endpoint: server.endpoint,
serverId: server.guild_id ?? server.channel_id,
token: server.token,
sessionId: state.session_id,
userId: state.user_id
}, Boolean(this.debug));
networking.once("close", this.onNetworkingClose);
networking.on("stateChange", this.onNetworkingStateChange);
networking.on("error", this.onNetworkingError);
networking.on("debug", this.onNetworkingDebug);
this.state = {
...this.state,
status: VoiceConnectionStatus.Connecting,
networking,
status: VoiceConnectionStatus.Connecting /* Connecting */,
networking
};
};
client.emit(
Events.DEBUG,
`${chalk.greenBright('[OK]')} Patched VoiceConnection.prototype.configureNetworking [@discordjs/voice]`,
`${chalk.greenBright('[OK]')} Patched VoiceConnection.prototype.configureNetworking [@discordjs/voice - v0.10.0]`,
);
/* eslint-enable */
}
@@ -128,11 +126,11 @@ module.exports = (client, { d: data }, shard) => {
*/
/*
for (const object of data.read_state) {
if (object.mention_count == 0) continue;
client.user.messageMentions.set(object.id, object);
}
*/
for (const object of data.read_state) {
if (object.mention_count == 0) continue;
client.user.messageMentions.set(object.id, object);
}
*/
for (const guild of data.guilds) {
guild.shardId = shard.id;

View File

@@ -77,7 +77,7 @@ class DiscordAuthWebsocket {
if (this.debug) console.log(`[WebSocket] Packet receive`, data);
let op = data.op;
if (op == Messages.HELLO) {
console.log('[WebSocket] Attempting server handshake...');
if (this.debug) console.log('[WebSocket] Attempting server handshake...');
this.heartbeat_interval = setInterval(() => {
this.heartbeat_sender();
}, data.heartbeat_interval);

File diff suppressed because it is too large Load Diff