Discolink
    Preparing search index...

    Interface PlayerOptions<Plugins>

    Options for creating a Player

    interface PlayerOptions<Plugins extends PlayerPlugin[] = PlayerPlugin[]> {
        nodes?: CreateNodeOptions[];
        plugins?: Plugins;
        autoInit?: boolean;
        autoSync?: boolean;
        queryPrefix?: string;
        nodePenalty?: number;
        voicePenalty?: number;
        regionWindow?: number;
        voiceTimeout?: number;
        voiceReconnect?: boolean;
        relocateQueues?: boolean;
        forwardVoiceUpdate: (
            guildId: string,
            payload: VoiceUpdatePayload,
        ) => Promise<void>;
        fetchRelatedTracks?: (
            queue: Queue,
            track: Track,
        ) => Promise<Track<CommonUserData, CommonPluginInfo>[]>;
    }

    Type Parameters

    Index

    Options for creating nodes on init

    plugins?: Plugins

    Plugins to initialize after creating nodes

    autoInit?: boolean

    Whether to initialize automatically upon receiving the bot's ready event.

    true
    
    autoSync?: boolean

    Whether to update players for nodes that couldn't resume.

    true
    
    queryPrefix?: string

    The prefix to use for search queries (not URLs) by default.

    "ytsearch"
    
    nodePenalty?: number

    Weight [0, 1] for penalizing nulled over deficit frames in streaming score.

    0.7
    
    voicePenalty?: number

    Weight [0, 1] for penalizing spiky over median latency in voice node selection.

    0
    
    regionWindow?: number

    Size (in ms) of the time window used by voice regions for monitoring node ping.

    Small windows rotate nodes more often, large windows keep one dominant before rotating.

    300_000
    
    voiceTimeout?: number

    Timeout for voice updates from Discord in ms.

    10_000
    
    voiceReconnect?: boolean

    Whether to reconnect (=> rejoin) for these voice close codes:

    • 4004 - incorrect token
    • 4011 - server not found
    • 4006 - session invalid
    true
    
    relocateQueues?: boolean

    Whether to relocate queues when a node closes/disconnects.

    true
    
    forwardVoiceUpdate: (
        guildId: string,
        payload: VoiceUpdatePayload,
    ) => Promise<void>

    Forward voice state updates to your bot's gateway connection

    Type Declaration

    fetchRelatedTracks?: (
        queue: Queue,
        track: Track,
    ) => Promise<Track<CommonUserData, CommonPluginInfo>[]>

    Return empty or populated array of related tracks

    Type Declaration

    Do NOT throw an error through this function