Player - JohnnyMorganz/discordia-lavalink GitHub Wiki

Constructor:

Player(VoiceManager, LavalinkNode, Guild, GuildVoiceChannel)

NOTE: YOU SHOULD NEVER HAVE TO CALL A PLAYER CONSTRUCTOR


Properties

boolean Player.playing

If a track has currently been loaded NOTE: This will be true even if the track is currently paused

boolean Player.paused

If the track has been paused

table|nil Player.track

The loaded track for the player. This table is the one retrieved from the API. View more here

table Player.info

Returns data about the Player and the track. This contains:

  • volume: The volume of the Player, 0 - 1000
  • startedAt: UTC epoch time when the track was started
  • position: The current position of the track in milliseconds
  • lastChecked: UTC epoch time when the last information about position was provided

Methods

Player:play(table track, table? options)

Play a track. The track specified should be retrieved from the API. Options can include:

  • startTime: position where track should be started
  • endTime: position where track should be ended

Player:pause(boolean pause)

Toggle if the player is paused

Player:resume()

Alias for Player:pause(false)

Player:stop()

Stop the track and clear it

Player:seek(number position)

Seek to a position in the track, in milliseconds

Player:volume(number? volume)

Set the volume of the player

Default: 100

Range: 0 - 1000

Player:equalizer(number band, number gain)

Utilize the player equalizer

Range of band: 0 - 14

Range of gain: -0.25 - 1

Player:destroy()

Internally delete the Player

NOTE: You should use VoiceManager:leave() instead