Class RainlinkPlayer

A class for managing player action.

Constructors

Properties

manager: Rainlink

Main manager class

Player's current using lavalink server

guildId: string

Player's guild id

voiceId: null | string

Player's voice id

textId: string

Player's text id

Player's queue

data: RainlinkDatabase<unknown>

The temporary database of player, u can set any thing here and us like Map class!

paused: boolean = true

Whether the player is paused or not

position: number = 0

Get the current track's position of the player

volume: number

Get the current volume of the player

playing: boolean = false

Whether the player is playing or not

Get the current loop mode of the player

Get the current state of the player

deaf: boolean

Whether the player is deafened or not

mute: boolean

Whether the player is muted or not

track: null | string = null

ID of the current track

functions: RainlinkFunctions

All function to extend support driver

shardId: number

ID of the Shard that contains the guild that contains the connected voice channel

Filter class to set, clear get the current filter data

Voice handler class

Methods

  • Internal

    Sends server update to lavalink

    Returns Promise<void>

  • Internal

    Destroy the player

    Returns Promise<void>

  • Pause or resume a track but different method

    Parameters

    • mode: boolean

      Whether to pause or not

    Returns Promise<RainlinkPlayer>

    RainlinkPlayer

  • Play the previous track

    Returns Promise<RainlinkPlayer>

    RainlinkPlayer

  • Get all previous track

    Returns RainlinkTrack[]

    RainlinkTrack[]

  • Skip the current track

    Returns Promise<RainlinkPlayer>

    RainlinkPlayer

  • Seek to another position in track

    Parameters

    • position: number

      Position to seek

    Returns Promise<RainlinkPlayer>

    RainlinkPlayer

  • Set another volume in player

    Parameters

    • volume: number

      Volume to cange

    Returns Promise<RainlinkPlayer>

    RainlinkPlayer

  • Set player to mute or unmute

    Parameters

    • enable: boolean

      Enable or not

    Returns RainlinkPlayer

    RainlinkPlayer

  • Stop all avtivities and reset to default

    Parameters

    • destroy: boolean

      Whenever you want to destroy a player or not

    Returns Promise<RainlinkPlayer>

    RainlinkPlayer

  • Reset all data to default

    Parameters

    • emitEmpty: boolean

      Whenever emit empty event or not

    Returns void

  • Set player to deaf or undeaf

    Parameters

    • enable: boolean

      Enable or not

    Returns RainlinkPlayer

    RainlinkPlayer

  • Disconnect from the voice channel

    Returns RainlinkPlayer

    RainlinkPlayer

  • Set text channel

    Parameters

    • textId: string

      Text channel ID

    Returns RainlinkPlayer

    RainlinkPlayer

  • Set voice channel and move the player to the voice channel

    Parameters

    • voiceId: string

      Voice channel ID

    Returns RainlinkPlayer

    RainlinkPlayer

  • Send custom player update data to lavalink server

    Parameters

    Returns Promise<RainlinkPlayer>

    RainlinkPlayer