mirror of
https://github.com/darksaid98/cadence-discord-bot.git
synced 2026-12-04 06:28:53 +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 loggerModule from '../../services/logger';
|
||||||
import { CreatePlayerParams } from '../../types/playerTypes';
|
import { CreatePlayerParams } from '../../types/playerTypes';
|
||||||
import { Logger } from 'pino';
|
|
||||||
|
|
||||||
export const createPlayer = async ({ client, executionId }: CreatePlayerParams) => {
|
export const createPlayer = async ({ client, executionId }: CreatePlayerParams) => {
|
||||||
const logger: Logger = loggerModule.child({
|
const logger: Logger = loggerModule.child({
|
||||||
@@ -12,11 +12,14 @@ export const createPlayer = async ({ client, executionId }: CreatePlayerParams)
|
|||||||
shardId: client.shard?.ids[0]
|
shardId: client.shard?.ids[0]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const ipRotationConfig = config.get<IPRotationConfig>('ipRotationConfig');
|
||||||
|
|
||||||
try {
|
try {
|
||||||
logger.debug('Creating discord-player player...');
|
logger.debug('Creating discord-player player...');
|
||||||
|
|
||||||
const player: Player = new Player(client, {
|
const player: Player = new Player(client, {
|
||||||
useLegacyFFmpeg: false,
|
useLegacyFFmpeg: false,
|
||||||
|
ipconfig: ipRotationConfig,
|
||||||
ytdlOptions: {
|
ytdlOptions: {
|
||||||
quality: 'highestaudio',
|
quality: 'highestaudio',
|
||||||
highWaterMark: 1 << 25,
|
highWaterMark: 1 << 25,
|
||||||
|
|||||||
Reference in new issue
Block a user