Skip to content

Commit

Permalink
chore: lint files
Browse files Browse the repository at this point in the history
  • Loading branch information
0t4u committed Aug 11, 2024
1 parent ef013ac commit 77003af
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 28 deletions.
12 changes: 6 additions & 6 deletions src/Constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,26 @@ export enum State {
CONNECTED,
RECONNECTING,
DISCONNECTING,
DISCONNECTED,
DISCONNECTED
}

export enum VoiceState {
SESSION_READY,
SESSION_ID_MISSING,
SESSION_ENDPOINT_MISSING,
SESSION_FAILED_UPDATE,
SESSION_FAILED_UPDATE
}

export enum OpCodes {
PLAYER_UPDATE = 'playerUpdate',
STATS = 'stats',
EVENT = 'event',
READY = 'ready',
READY = 'ready'
}

export const Versions = {
REST_VERSION: 4,
WEBSOCKET_VERSION: 4,
WEBSOCKET_VERSION: 4
};

export const ShoukakuDefaults: Required<ShoukakuOptions> = {
Expand All @@ -43,7 +43,7 @@ export const ShoukakuDefaults: Required<ShoukakuOptions> = {
nodeResolver: (nodes) => [ ...nodes.values() ]
.filter(node => node.state === State.CONNECTED)
.sort((a, b) => a.penalties - b.penalties)
.shift(),
.shift()
};

export const ShoukakuClientInfo = `${Info.name}/${Info.version} (${Info.repository.url})`;
Expand All @@ -53,5 +53,5 @@ export const NodeDefaults: NodeOption = {
url: '',
auth: '',
secure: false,
group: undefined,
group: undefined
};
2 changes: 1 addition & 1 deletion src/connectors/libs/Seyfert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class Seyfert extends Connector {
if (packet.t === 'READY') return this.ready(nodes);
// Attach to the raw websocket event, this event must be 1:1 on spec with dapi (most libs implement this)
return this.raw(packet);
},
}
};
}
}
4 changes: 2 additions & 2 deletions src/node/Node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export class Node extends EventEmitter {
'Client-Name': ShoukakuClientInfo,
'User-Agent': this.manager.options.userAgent,
'Authorization': this.auth,
'User-Id': this.manager.id,
'User-Id': this.manager.id
};

if (this.sessionId) headers['Session-Id'] = this.sessionId;
Expand Down Expand Up @@ -410,7 +410,7 @@ export class Node extends EventEmitter {

await Promise.allSettled([
...playersWithData.map(player => player.resume()),
...playersWithoutData.map(player => this.manager.leaveVoiceChannel(player.guildId)),
...playersWithoutData.map(player => this.manager.leaveVoiceChannel(player.guildId))
]);
}

Expand Down
38 changes: 19 additions & 19 deletions src/node/Rest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export enum LoadType {
PLAYLIST = 'playlist',
SEARCH = 'search',
EMPTY = 'empty',
ERROR = 'error',
ERROR = 'error'
}

export interface Track {
Expand Down Expand Up @@ -208,7 +208,7 @@ export class Rest {
public resolve(identifier: string): Promise<LavalinkResponse | undefined> {
const options = {
endpoint: '/loadtracks',
options: { params: { identifier }},
options: { params: { identifier }}
};
return this.fetch(options);
}
Expand All @@ -221,7 +221,7 @@ export class Rest {
public decode(track: string): Promise<Track | undefined> {
const options = {
endpoint: '/decodetrack',
options: { params: { track }},
options: { params: { track }}
};
return this.fetch<Track>(options);
}
Expand All @@ -233,7 +233,7 @@ export class Rest {
public async getPlayers(): Promise<LavalinkPlayer[]> {
const options = {
endpoint: `/sessions/${this.sessionId}/players`,
options: {},
options: {}
};
return await this.fetch<LavalinkPlayer[]>(options) ?? [];
}
Expand All @@ -245,7 +245,7 @@ export class Rest {
public getPlayer(guildId: string): Promise<LavalinkPlayer | undefined> {
const options = {
endpoint: `/sessions/${this.sessionId}/players/${guildId}`,
options: {},
options: {}
};
return this.fetch(options);
}
Expand All @@ -262,8 +262,8 @@ export class Rest {
method: 'PATCH',
params: { noReplace: data.noReplace?.toString() ?? 'false' },
headers: { 'Content-Type': 'application/json' },
body: data.playerOptions as Record<string, unknown>,
},
body: data.playerOptions as Record<string, unknown>
}
};
return this.fetch<LavalinkPlayer>(options);
}
Expand All @@ -275,7 +275,7 @@ export class Rest {
public async destroyPlayer(guildId: string): Promise<void> {
const options = {
endpoint: `/sessions/${this.sessionId}/players/${guildId}`,
options: { method: 'DELETE' },
options: { method: 'DELETE' }
};
await this.fetch(options);
}
Expand All @@ -292,8 +292,8 @@ export class Rest {
options: {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
body: { resuming, timeout },
},
body: { resuming, timeout }
}
};
return this.fetch(options);
}
Expand All @@ -305,7 +305,7 @@ export class Rest {
public stats(): Promise<Stats | undefined> {
const options = {
endpoint: '/stats',
options: {},
options: {}
};
return this.fetch(options);
}
Expand All @@ -317,7 +317,7 @@ export class Rest {
public getRoutePlannerStatus(): Promise<RoutePlanner | undefined> {
const options = {
endpoint: '/routeplanner/status',
options: {},
options: {}
};
return this.fetch(options);
}
Expand All @@ -332,8 +332,8 @@ export class Rest {
options: {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: { address },
},
body: { address }
}
};
await this.fetch(options);
}
Expand All @@ -345,8 +345,8 @@ export class Rest {
const options = {
endpoint: '/info',
options: {
headers: { 'Content-Type': 'application/json' },
},
headers: { 'Content-Type': 'application/json' }
}
};
return this.fetch(options);
}
Expand All @@ -362,7 +362,7 @@ export class Rest {
const { endpoint, options } = fetchOptions;
let headers = {
'Authorization': this.auth,
'User-Agent': this.node.manager.options.userAgent,
'User-Agent': this.node.manager.options.userAgent
};

if (options.headers) headers = { ...headers, ...options.headers };
Expand All @@ -379,7 +379,7 @@ export class Rest {
const finalFetchOptions: FinalFetchOptions = {
method,
headers,
signal: abortController.signal,
signal: abortController.signal
};

if (![ 'GET', 'HEAD' ].includes(method) && options.body)
Expand All @@ -397,7 +397,7 @@ export class Rest {
status: request.status,
error: 'Unknown Error',
message: 'Unexpected error response from Lavalink server',
path: endpoint,
path: endpoint
});
}
try {
Expand Down

0 comments on commit 77003af

Please sign in to comment.