Skip to content

Commit

Permalink
chore: deps
Browse files Browse the repository at this point in the history
  • Loading branch information
iCrawl committed Sep 4, 2022
1 parent dadc325 commit 40266cb
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@
"@types/node": "^16.11.56",
"downlevel-dts": "^0.10.1",
"eslint": "^8.23.0",
"eslint-config-neon": "^0.1.31",
"jest": "^29.0.1",
"eslint-config-neon": "^0.1.33",
"jest": "^29.0.2",
"jest-websocket-mock": "^2.4.0",
"mock-socket": "^9.1.5",
"prettier": "^2.7.1",
Expand Down
9 changes: 3 additions & 6 deletions src/VoiceConnection.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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);
Expand All @@ -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),
Expand Down
1 change: 0 additions & 1 deletion src/networking/Networking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 0 additions & 2 deletions src/receive/VoiceReceiver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -124,7 +123,6 @@ export class VoiceReceiver {
packet = packet.subarray(4 + 4 * headerExtensionLength);
}

// eslint-disable-next-line consistent-return
return packet;
}

Expand Down

0 comments on commit 40266cb

Please sign in to comment.