Skip to content

Commit

Permalink
chore: run lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Deivu committed Aug 28, 2024
1 parent 71619f5 commit 670f320
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions src/guild/Player.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {Node} from '../node/Node';
import {Connection} from './Connection';
import {OpCodes, State} from '../Constants';
import {Exception, Track, UpdatePlayerInfo, UpdatePlayerOptions} from '../node/Rest';
import {TypedEventEmitter} from '../Utils';
import { Node } from '../node/Node';
import { Connection } from './Connection';
import { OpCodes, State } from '../Constants';
import { Exception, Track, UpdatePlayerInfo, UpdatePlayerOptions } from '../node/Rest';
import { TypedEventEmitter } from '../Utils';

export type TrackEndReason = 'finished' | 'loadFailed' | 'stopped' | 'replaced' | 'cleanup';
export type PlayOptions = Omit<UpdatePlayerOptions, 'filters' | 'voice'>;
Expand Down Expand Up @@ -243,7 +243,7 @@ export class Player extends TypedEventEmitter<PlayerEvents> {
const connection = this.node.manager.connections.get(this.guildId);
const node = this.node.manager.nodes.get(name!) ?? this.node.manager.getIdealNode(connection);

if (!node && ![...this.node.manager.nodes.values()].some(node => node.state === State.CONNECTED))
if (!node && ![ ...this.node.manager.nodes.values() ].some(node => node.state === State.CONNECTED))
throw new Error('No available nodes to move to');

if (!node || node.name === this.node.name || node.state !== State.CONNECTED) return false;
Expand Down Expand Up @@ -283,87 +283,87 @@ export class Player extends TypedEventEmitter<PlayerEvents> {
* Stop the currently playing track
*/
public stopTrack(): Promise<void> {
return this.update({track: {encoded: null}, position: 0});
return this.update({ track: { encoded: null }, position: 0 });
}

/**
* Pause or unpause the currently playing track
* @param paused Boolean value to specify whether to pause or unpause the current bot user
*/
public setPaused(paused = true): Promise<void> {
return this.update({paused});
return this.update({ paused });
}

/**
* Seek to a specific time in the currently playing track
* @param position Position to seek to in milliseconds
*/
public seekTo(position: number): Promise<void> {
return this.update({position});
return this.update({ position });
}

/**
* Sets the global volume of the player
* @param volume Target volume 0-1000
*/
public setGlobalVolume(volume: number): Promise<void> {
return this.update({volume});
return this.update({ volume });
}

/**
* Sets the filter volume of the player
* @param volume Target volume 0.0-5.0
*/
async setFilterVolume(volume: number): Promise<void> {
return this.setFilters({volume});
return this.setFilters({ volume });
}

/**
* Change the equalizer settings applied to the currently playing track
* @param equalizer An array of objects that conforms to the Bands type that define volumes at different frequencies
*/
public async setEqualizer(equalizer: Band[]): Promise<void> {
return this.setFilters({equalizer});
return this.setFilters({ equalizer });
}

/**
* Change the karaoke settings applied to the currently playing track
* @param karaoke An object that conforms to the KaraokeSettings type that defines a range of frequencies to mute
*/
public setKaraoke(karaoke?: KaraokeSettings): Promise<void> {
return this.setFilters({karaoke: karaoke ?? null});
return this.setFilters({ karaoke: karaoke ?? null });
}

/**
* Change the timescale settings applied to the currently playing track
* @param timescale An object that conforms to the TimescaleSettings type that defines the time signature to play the audio at
*/
public setTimescale(timescale?: TimescaleSettings): Promise<void> {
return this.setFilters({timescale: timescale ?? null});
return this.setFilters({ timescale: timescale ?? null });
}

/**
* Change the tremolo settings applied to the currently playing track
* @param tremolo An object that conforms to the FreqSettings type that defines an oscillation in volume
*/
public setTremolo(tremolo?: FreqSettings): Promise<void> {
return this.setFilters({tremolo: tremolo ?? null});
return this.setFilters({ tremolo: tremolo ?? null });
}

/**
* Change the vibrato settings applied to the currently playing track
* @param vibrato An object that conforms to the FreqSettings type that defines an oscillation in pitch
*/
public setVibrato(vibrato?: FreqSettings): Promise<void> {
return this.setFilters({vibrato: vibrato ?? null});
return this.setFilters({ vibrato: vibrato ?? null });
}

/**
* Change the rotation settings applied to the currently playing track
* @param rotation An object that conforms to the RotationSettings type that defines the frequency of audio rotating round the listener
*/
public setRotation(rotation?: RotationSettings): Promise<void> {
return this.setFilters({rotation: rotation ?? null});
return this.setFilters({ rotation: rotation ?? null });
}

/**
Expand All @@ -372,31 +372,31 @@ export class Player extends TypedEventEmitter<PlayerEvents> {
* @returns The current player instance
*/
public setDistortion(distortion?: DistortionSettings): Promise<void> {
return this.setFilters({distortion: distortion ?? null});
return this.setFilters({ distortion: distortion ?? null });
}

/**
* Change the channel mix settings applied to the currently playing track
* @param channelMix An object that conforms to ChannelMixSettings that defines how much the left and right channels affect each other (setting all factors to 0.5 causes both channels to get the same audio)
*/
public setChannelMix(channelMix?: ChannelMixSettings): Promise<void> {
return this.setFilters({channelMix: channelMix ?? null});
return this.setFilters({ channelMix: channelMix ?? null });
}

/**
* Change the low pass settings applied to the currently playing track
* @param lowPass An object that conforms to LowPassSettings that defines the amount of suppression on higher frequencies
*/
public setLowPass(lowPass?: LowPassSettings): Promise<void> {
return this.setFilters({lowPass: lowPass ?? null});
return this.setFilters({ lowPass: lowPass ?? null });
}

/**
* Change the all filter settings applied to the currently playing track
* @param filters An object that conforms to FilterOptions that defines all filters to apply/modify
*/
public setFilters(filters: FilterOptions): Promise<void> {
return this.update({filters});
return this.update({ filters });
}

/**
Expand Down Expand Up @@ -456,7 +456,7 @@ export class Player extends TypedEventEmitter<PlayerEvents> {
if (!noReplace) this.paused = false;

if (playerOptions.filters) {
this.filters = {...this.filters, ...playerOptions.filters};
this.filters = { ...this.filters, ...playerOptions.filters };
}

if (typeof playerOptions.track !== 'undefined')
Expand Down Expand Up @@ -503,7 +503,7 @@ export class Player extends TypedEventEmitter<PlayerEvents> {
* Handle player update data
*/
public onPlayerUpdate(json: PlayerUpdate): void {
const {position, ping} = json.state;
const { position, ping } = json.state;
this.position = position;
this.ping = ping;
this.emit('update', json);
Expand Down

0 comments on commit 670f320

Please sign in to comment.