Class Player<Context, Plugins>

Main Player class - entry point for Ryanlink Manages nodes, voices, queues, and plugins

Type Parameters

  • Context extends Record<string, unknown> = QueueContext
  • Plugins extends PlayerPlugin[] = []

Hierarchy

  • EventEmitter<ConstrainEventMap<PlayerEventMap & MergeUnionType<PluginEventMap<Plugins[number]>>>>
    • Player

Constructors

Properties

options: PlayerInstanceOptions
plugins: PluginRecord<Plugins>
voices: VoiceManager

Accessors

Methods

  • Initialize the player

    Parameters

    • clientId: string

      Bot client ID

    Returns Promise<void>

  • Destroys the queue of a guild

    Parameters

    • guildId: string

      Id of the guild

    • Optional reason: string

      Reason for destroying

    Returns Promise<void>

  • Searches for results based on query and options

    Parameters

    • query: string

      Query (or URL as well)

    • Optional options: SearchOptions

      Options for customization

    Returns Promise<SearchResult>

  • Adds or searches if source is query and resumes the queue if stopped

    Parameters

    • source: string | Track<CommonUserData, CommonPluginInfo> | Track<CommonUserData, CommonPluginInfo>[] | Playlist<CommonPluginInfo>

      Source to play from

    • options: PlayOptions<Context, CommonUserData>

      Options for customization

    Returns Promise<Queue<Context>>

  • Jumps to the specified index in queue of a guild

    Parameters

    • guildId: string

      Id of the guild

    • index: number

      Index to jump to

    Returns Promise<Track<CommonUserData, CommonPluginInfo>>

  • Pauses the queue of a guild

    Parameters

    • guildId: string

      Id of the guild

    Returns Promise<boolean>

  • Plays the previous track in queue of a guild

    Parameters

    • guildId: string

      Id of the guild

    Returns Promise<null | Track<CommonUserData, CommonPluginInfo>>

  • Resumes the queue of a guild

    Parameters

    • guildId: string

      Id of the guild

    Returns Promise<boolean>

  • Seeks to a position in the current track of a guild

    Parameters

    • guildId: string

      Id of the guild

    • ms: number

      Position in milliseconds

    Returns Promise<number>

  • Enables or disables autoplay for the queue of a guild

    Parameters

    • guildId: string

      Id of the guild

    • Optional autoplay: boolean

      Whether to enable autoplay

    Returns boolean

  • Sets the repeat mode for the queue of a guild

    Parameters

    • guildId: string

      Id of the guild

    • repeatMode: RepeatMode

      The repeat mode

    Returns RepeatMode

  • Sets the volume of the queue of a guild

    Parameters

    • guildId: string

      Id of the guild

    • volume: number

      The volume to set

    Returns Promise<number>

  • Shuffles tracks for the queue of a guild

    Parameters

    • guildId: string

      Id of the guild

    • Optional includePrevious: boolean

      Whether to pull previous tracks to current

    Returns Queue<Context>

  • Plays the next track in queue of a guild

    Parameters

    • guildId: string

      Id of the guild

    Returns Promise<null | Track<CommonUserData, CommonPluginInfo>>

  • Stops the queue of a guild

    Parameters

    • guildId: string

      Id of the guild

    Returns Promise<void>