Search Results for

    Show / Hide Table of Contents

    Class LavalinkGuildConnection

    Represents a Lavalink connection to a channel.

    Inheritance
    System.Object
    LavalinkGuildConnection
    Namespace: DisCatSharp.Lavalink
    Assembly: DisCatSharp.Lavalink.dll
    Syntax
    public sealed class LavalinkGuildConnection

    Properties

    | Improve this Doc View Source

    Channel

    Gets the voice channel associated with this connection.

    Declaration
    public DiscordChannel Channel { get; }
    Property Value
    Type Description
    DiscordChannel
    | Improve this Doc View Source

    CurrentState

    Gets the current player state.

    Declaration
    public LavalinkPlayerState CurrentState { get; }
    Property Value
    Type Description
    LavalinkPlayerState
    | Improve this Doc View Source

    Guild

    Gets the guild associated with this connection.

    Declaration
    public DiscordGuild Guild { get; }
    Property Value
    Type Description
    DiscordGuild
    | Improve this Doc View Source

    IsConnected

    Gets whether this channel is still connected.

    Declaration
    public bool IsConnected { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Node

    Gets the Lavalink node associated with this connection.

    Declaration
    public LavalinkNodeConnection Node { get; }
    Property Value
    Type Description
    LavalinkNodeConnection

    Methods

    | Improve this Doc View Source

    AdjustEqualizerAsync(LavalinkBandAdjustment[])

    Adjusts the specified bands in the audio equalizer. This will alter the sound output, and might incur a lot of CPU usage.

    Declaration
    public async Task AdjustEqualizerAsync(params LavalinkBandAdjustment[] bands)
    Parameters
    Type Name Description
    LavalinkBandAdjustment[] bands

    Bands adjustments to make. You must specify one adjustment per band at most.

    Returns
    Type Description
    System.Threading.Tasks.Task
    | Improve this Doc View Source

    DisconnectAsync(Boolean)

    Disconnects the connection from the voice channel.

    Declaration
    public Task DisconnectAsync(bool shouldDestroy = true)
    Parameters
    Type Name Description
    System.Boolean shouldDestroy

    Whether the connection should be destroyed on the Lavalink server when leaving.

    Returns
    Type Description
    System.Threading.Tasks.Task
    | Improve this Doc View Source

    GetTracksAsync(FileInfo)

    Loads tracks from a local file.

    Declaration
    public Task<LavalinkLoadResult> GetTracksAsync(FileInfo file)
    Parameters
    Type Name Description
    System.IO.FileInfo file

    File to load tracks from.

    Returns
    Type Description
    System.Threading.Tasks.Task<LavalinkLoadResult>

    A collection of tracks from the file.

    | Improve this Doc View Source

    GetTracksAsync(String, LavalinkSearchType)

    Searches for specified terms.

    Declaration
    public Task<LavalinkLoadResult> GetTracksAsync(string searchQuery, LavalinkSearchType type = LavalinkSearchType.Youtube)
    Parameters
    Type Name Description
    System.String searchQuery

    What to search for.

    LavalinkSearchType type

    What platform will search for.

    Returns
    Type Description
    System.Threading.Tasks.Task<LavalinkLoadResult>

    A collection of tracks matching the criteria.

    | Improve this Doc View Source

    GetTracksAsync(Uri)

    Loads tracks from specified URL.

    Declaration
    public Task<LavalinkLoadResult> GetTracksAsync(Uri uri)
    Parameters
    Type Name Description
    System.Uri uri

    URL to load tracks from.

    Returns
    Type Description
    System.Threading.Tasks.Task<LavalinkLoadResult>

    A collection of tracks from the URL.

    | Improve this Doc View Source

    PauseAsync()

    Pauses the player.

    Declaration
    public async Task PauseAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task
    | Improve this Doc View Source

    PlayAsync(LavalinkTrack)

    Queues the specified track for playback.

    Declaration
    public async Task PlayAsync(LavalinkTrack track)
    Parameters
    Type Name Description
    LavalinkTrack track

    Track to play.

    Returns
    Type Description
    System.Threading.Tasks.Task
    | Improve this Doc View Source

    PlayPartialAsync(LavalinkTrack, TimeSpan, TimeSpan)

    Queues the specified track for playback. The track will be played from specified start timestamp to specified end timestamp.

    Declaration
    public async Task PlayPartialAsync(LavalinkTrack track, TimeSpan start, TimeSpan end)
    Parameters
    Type Name Description
    LavalinkTrack track

    Track to play.

    System.TimeSpan start

    Timestamp to start playback at.

    System.TimeSpan end

    Timestamp to stop playback at.

    Returns
    Type Description
    System.Threading.Tasks.Task
    | Improve this Doc View Source

    ResetEqualizerAsync()

    Resets the audio equalizer to default values.

    Declaration
    public async Task ResetEqualizerAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task
    | Improve this Doc View Source

    ResumeAsync()

    Resumes playback.

    Declaration
    public async Task ResumeAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task
    | Improve this Doc View Source

    SeekAsync(TimeSpan)

    Seeks the current track to specified position.

    Declaration
    public async Task SeekAsync(TimeSpan position)
    Parameters
    Type Name Description
    System.TimeSpan position

    Position to seek to.

    Returns
    Type Description
    System.Threading.Tasks.Task
    | Improve this Doc View Source

    SetVolumeAsync(Int32)

    Sets the playback volume. This might incur a lot of CPU usage.

    Declaration
    public async Task SetVolumeAsync(int volume)
    Parameters
    Type Name Description
    System.Int32 volume

    Volume to set. Needs to be greater or equal to 0, and less than or equal to 100. 100 means 100% and is the default value.

    Returns
    Type Description
    System.Threading.Tasks.Task
    | Improve this Doc View Source

    StopAsync()

    Stops the player completely.

    Declaration
    public async Task StopAsync()
    Returns
    Type Description
    System.Threading.Tasks.Task

    Events

    | Improve this Doc View Source

    DiscordWebSocketClosed

    Triggered whenever Discord Voice WebSocket connection is terminated.

    Declaration
    public event AsyncEventHandler<LavalinkGuildConnection, WebSocketCloseEventArgs> DiscordWebSocketClosed
    Event Type
    Type Description
    AsyncEventHandler<LavalinkGuildConnection, WebSocketCloseEventArgs>
    | Improve this Doc View Source

    PlaybackFinished

    Triggered whenever playback of a track finishes.

    Declaration
    public event AsyncEventHandler<LavalinkGuildConnection, TrackFinishEventArgs> PlaybackFinished
    Event Type
    Type Description
    AsyncEventHandler<LavalinkGuildConnection, TrackFinishEventArgs>
    | Improve this Doc View Source

    PlaybackStarted

    Triggered whenever playback of a track starts.

    This is only available for version 3.3.1 and greater.

    Declaration
    public event AsyncEventHandler<LavalinkGuildConnection, TrackStartEventArgs> PlaybackStarted
    Event Type
    Type Description
    AsyncEventHandler<LavalinkGuildConnection, TrackStartEventArgs>
    | Improve this Doc View Source

    PlayerUpdated

    Triggered whenever Lavalink updates player status.

    Declaration
    public event AsyncEventHandler<LavalinkGuildConnection, PlayerUpdateEventArgs> PlayerUpdated
    Event Type
    Type Description
    AsyncEventHandler<LavalinkGuildConnection, PlayerUpdateEventArgs>
    | Improve this Doc View Source

    TrackException

    Triggered whenever playback of a track encounters an error.

    Declaration
    public event AsyncEventHandler<LavalinkGuildConnection, TrackExceptionEventArgs> TrackException
    Event Type
    Type Description
    AsyncEventHandler<LavalinkGuildConnection, TrackExceptionEventArgs>
    | Improve this Doc View Source

    TrackStuck

    Triggered whenever playback of a track gets stuck.

    Declaration
    public event AsyncEventHandler<LavalinkGuildConnection, TrackStuckEventArgs> TrackStuck
    Event Type
    Type Description
    AsyncEventHandler<LavalinkGuildConnection, TrackStuckEventArgs>

    Extension Methods

    ReflectionUtilities.ToDictionary<T>(T)
    • Improve this Doc
    • View Source
    In This Article
    Back to top © 2021-2022 Aiko IT Systems