From cfd45fc711c31c9bfb1801a3335b4604d9fdcce1 Mon Sep 17 00:00:00 2001 From: Marius Begby Date: Sun, 3 Sep 2023 17:56:59 +0200 Subject: [PATCH] feat: support new discord-player ip rotation config --- src/utils/factory/createPlayer.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/utils/factory/createPlayer.ts b/src/utils/factory/createPlayer.ts index 968a436..96dc5bc 100644 --- a/src/utils/factory/createPlayer.ts +++ b/src/utils/factory/createPlayer.ts @@ -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({ @@ -12,11 +12,14 @@ export const createPlayer = async ({ client, executionId }: CreatePlayerParams) shardId: client.shard?.ids[0] }); + const ipRotationConfig = config.get('ipRotationConfig'); + try { logger.debug('Creating discord-player player...'); const player: Player = new Player(client, { useLegacyFFmpeg: false, + ipconfig: ipRotationConfig, ytdlOptions: { quality: 'highestaudio', highWaterMark: 1 << 25,