chore: deps

This commit is contained in:
iCrawl
2022-09-04 19:33:57 +02:00
parent 8b3d006118
commit 4ffdada4f7
21 changed files with 722 additions and 612 deletions

View File

@@ -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),

View File

@@ -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;
}

View File

@@ -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;
}