mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-14 18:43:31 +01:00
chore: deps
This commit is contained in:
@@ -1,7 +1,4 @@
|
||||
/* eslint-disable consistent-return */
|
||||
/* eslint-disable @typescript-eslint/unbound-method */
|
||||
/* eslint-disable jsdoc/check-param-names */
|
||||
/* eslint-disable @typescript-eslint/method-signature-style */
|
||||
import type { Buffer } from 'node:buffer';
|
||||
import { EventEmitter } from 'node:events';
|
||||
import type { GatewayVoiceServerUpdateDispatchData, GatewayVoiceStateUpdateDispatchData } from 'discord-api-types/v10';
|
||||
@@ -244,10 +241,10 @@ export class VoiceConnection extends EventEmitter {
|
||||
* @param joinConfig - The data required to establish the voice connection
|
||||
* @param options - The options used to create this voice connection
|
||||
*/
|
||||
public constructor(joinConfig: JoinConfig, { debug, adapterCreator }: CreateVoiceConnectionOptions) {
|
||||
public constructor(joinConfig: JoinConfig, options: CreateVoiceConnectionOptions) {
|
||||
super();
|
||||
|
||||
this.debug = debug ? (message: string) => this.emit('debug', message) : null;
|
||||
this.debug = options.debug ? (message: string) => this.emit('debug', message) : null;
|
||||
this.rejoinAttempts = 0;
|
||||
|
||||
this.receiver = new VoiceReceiver(this);
|
||||
@@ -257,7 +254,7 @@ export class VoiceConnection extends EventEmitter {
|
||||
this.onNetworkingError = this.onNetworkingError.bind(this);
|
||||
this.onNetworkingDebug = this.onNetworkingDebug.bind(this);
|
||||
|
||||
const adapter = adapterCreator({
|
||||
const adapter = options.adapterCreator({
|
||||
onVoiceServerUpdate: (data) => this.addServerPacket(data),
|
||||
onVoiceStateUpdate: (data) => this.addStatePacket(data),
|
||||
destroy: () => this.destroy(false),
|
||||
|
||||
@@ -489,7 +489,6 @@ export class Networking extends EventEmitter {
|
||||
const state = this.state;
|
||||
if (state.code !== NetworkingStatusCode.Ready) return;
|
||||
state.preparedPacket = this.createAudioPacket(opusPacket, state.connectionData);
|
||||
// eslint-disable-next-line consistent-return
|
||||
return state.preparedPacket;
|
||||
}
|
||||
|
||||
|
||||
@@ -101,7 +101,6 @@ export class VoiceReceiver {
|
||||
// Open packet
|
||||
const decrypted = methods.open(buffer.slice(12, end), nonce, secretKey);
|
||||
if (!decrypted) return;
|
||||
// eslint-disable-next-line consistent-return
|
||||
return Buffer.from(decrypted);
|
||||
}
|
||||
|
||||
@@ -124,7 +123,6 @@ export class VoiceReceiver {
|
||||
packet = packet.subarray(4 + 4 * headerExtensionLength);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line consistent-return
|
||||
return packet;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user