Lavacord
    Preparing search index...

    Class Player

    The Player class, this handles everything to do with the guild sides of things, like playing, stoping, pausing, resuming etc

    Hierarchy

    • EventEmitter
      • Player
    Index

    Constructors

    Properties

    id: string

    the id of the player, aka the guild id

    The Lavalink of the player

    paused: boolean = false

    Whether or not the song that is playing is paused or not

    playing: boolean = false

    Whether or not the player is actually playing anything

    state: Partial<PlayerState> & { filters: Filters } = ...

    The PlayerState of this Player

    timestamp: null | number = null

    When the track started playing

    track: null | string = null

    The current track in Lavalink's base64 string form

    voiceUpdateState: null | PlayerUpdateVoiceState = null

    The voiceUpdateState of the player, used for swtiching nodes

    Accessors

    Methods

    • Sends a destroy signal to lavalink, basically just a cleanup op for lavalink to clean its shit up

      Returns Promise<void>

    • Sets the equalizer of the current song, if you wanted to do something like bassboost

      Parameters

      • bands: Equalizer[]

        The bands that you want lavalink to modify read IMPLEMENTATION.md for more information

      Returns Promise<Player>

    • Parameters

      • options: Filters

      Returns Promise<Player>

    • Pauses/Resumes the song depending on what is specified

      Parameters

      • pause: boolean

        Whether or not to pause whats currently playing

      Returns Promise<Player>

    • Plays the specified song using the base64 string from lavalink

      Parameters

      • track: string

        The base64 string of the song that you want to play

      • Optionaloptions: Omit<UpdatePlayerData, "track"> & {
            noReplace?: boolean;
            userData?: Record<any, any>;
        }

        Play options

      Returns Promise<Player>

    • Parameters

      • Optionalevent: keyof PlayerEvents

      Returns this

    • Resumes the current song

      Returns Promise<Player>

    • Seeks the current song to a certain position

      Parameters

      • position: number

        Seeks the song to the position specified in milliseconds, use the duration of the song from lavalink to get the duration

      Returns Promise<Player>

    • Stops the music, depending on how the end event is handled this will either stop

      Returns Promise<Player>

    • Use this to switch channels

      Parameters

      • channel: string

        The channel id of the channel you want to switch to

      • options: JoinOptions = {}

        selfMute and selfDeaf options

      Returns any

    • Updates the current player on lavalink

      Parameters

      • options: UpdatePlayerData

        Update options

      • noReplace: boolean = false

        If the event should be dropped if there's a currently playing track should encodedTrack or identifier be present in options

      Returns Promise<Player>

    • Changes the volume, only for the current song

      Parameters

      • volume: number

        The volume as a float from 0.0 to 10.0. 1.0 is default.

      Returns Promise<Player>