mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-02 14:38:49 +00:00
feat: support new discord-player ip rotation config
This commit is contained in:
1 parent
8dd88609f8
commit
cfd45fc711
1 file changed
+6
-3
@@ -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>('ipRotationConfig');
|
||||
|
||||
try {
|
||||
logger.debug('Creating discord-player player...');
|
||||
|
||||
const player: Player = new Player(client, {
|
||||
useLegacyFFmpeg: false,
|
||||
ipconfig: ipRotationConfig,
|
||||
ytdlOptions: {
|
||||
quality: 'highestaudio',
|
||||
highWaterMark: 1 << 25,
|
||||
|
||||
Reference in new issue
Block a user