Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.

Commit

Permalink
feat: support new discord-player ip rotation config
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusbegby committed Sep 3, 2023
1 parent 8dd8860 commit cfd45fc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/utils/factory/createPlayer.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Player } from 'discord-player';

import config from 'config';
import { IPRotationConfig, Player } from 'discord-player';
import { Logger } from 'pino';
import loggerModule from '../../services/logger';
import { CreatePlayerParams } from '../../types/playerTypes';
import { Logger } from 'pino';

export const createPlayer = async ({ client, executionId }: CreatePlayerParams) => {
const logger: Logger = loggerModule.child({
Expand All @@ -12,11 +12,14 @@ export const createPlayer = async ({ client, executionId }: CreatePlayerParams)
shardId: client.shard?.ids[0]
});

const ipRotationConfig = config.get<IPRotationConfig>('ipRotationConfig');

try {
logger.debug('Creating discord-player player...');

const player: Player = new Player(client, {
useLegacyFFmpeg: false,
ipconfig: ipRotationConfig,
ytdlOptions: {
quality: 'highestaudio',
highWaterMark: 1 << 25,
Expand Down

0 comments on commit cfd45fc

Please # to comment.