LavalinkPlugin class
A plugin that adds Lavalink support to NyxxGateway
clients.
Constructors
- LavalinkPlugin({required Uri base, required String password})
- Create a new LavalinkPlugin.
- LavalinkPlugin.usingClient(LavalinkClient _customClient)
- Create a new LavalinkPlugin that uses a custom LavalinkClient.
Properties
- base → Uri
-
The URI relative to which the Lavalink API is accessed.
final
-
clientType
→ RuntimeType<
NyxxGateway> -
The type of client this plugin requires.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- logger → Logger
-
A logger that can be used to log messages from this plugin.
no setterinherited
- name → String
-
The name of this plugin.
no setterinherited
-
onEvent
→ Stream<
LavalinkEvent> -
A stream of
LavalinkEvent
s received by Lavalink clients created by this plugin.no setter -
onMessage
→ Stream<
LavalinkMessage> -
A stream of messages received by Lavalink clients created by this plugin.
no setter
-
onPlayerConnected
→ Stream<
LavalinkPlayer> -
A stream of
LavalinkPlayer
s emitted when a Lavalink player connects to a voice channel.no setter -
onPlayerUpdate
→ Stream<
PlayerUpdateMessage> -
A stream of
PlayerUpdateMessage
s received by Lavalink clients created by this plugin.no setter -
onReady
→ Stream<
LavalinkReadyMessage> -
A stream of
LavalinkReadyMessage
s received by Lavalink clients created by this plugin.no setter -
onStats
→ Stream<
StatsMessage> -
A stream of
StatsMessage
s received by Lavalink clients created by this plugin.no setter -
onTrackEnd
→ Stream<
TrackEndEvent> -
A stream of
TrackEndEvent
s received by Lavalink clients created by this plugin.no setter -
onTrackException
→ Stream<
TrackExceptionEvent> -
A stream of
TrackExceptionEvent
s received by Lavalink clients created by this plugin.no setter -
onTrackStart
→ Stream<
TrackStartEvent> -
A stream of
TrackStartEvent
s received by Lavalink clients created by this plugin.no setter -
onTrackStuck
→ Stream<
TrackStuckEvent> -
A stream of
TrackStuckEvent
s received by Lavalink clients created by this plugin.no setter -
onWebsocketClosed
→ Stream<
WebSocketClosedEvent> -
A stream of
WebSocketClosedEvent
s received by Lavalink clients created by this plugin.no setter - password → String
-
The password to use when authenticating with the Lavalink server.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
afterClose(
) → FutureOr< void> -
Called after each client this plugin is added to closes.
inherited
-
afterConnect(
NyxxGateway client) → FutureOr< void> -
Called after each client this plugin is added to connects.
inherited
-
beforeClose(
NyxxGateway client) → FutureOr< void> -
Called before each client this plugin is added to closes.
inherited
-
beforeConnect(
ApiOptions apiOptions, ClientOptions clientOptions) → FutureOr< void> -
Called before each client this plugin is added to connects.
inherited
-
connect(
NyxxGateway client, Snowflake channelId, Snowflake guildId) → Future< LavalinkPlayer> - Connect to a voice channel using Lavalink.
-
createState(
) → NyxxPluginState< NyxxGateway, LavalinkPlugin> - Called to create the state for this plugin.
-
decodeTrack(
String encodedTrack) → Future< Track> - Decode a base64-encoded Track.
-
decodeTracks(
List< String> encodedTracks) → Future<List< Track> > - Decode multiple base64-encoded Tracks.
-
doClose(
NyxxGateway client, Future< void> close()) → Future<void> -
Perform the close operation.
inherited
-
doConnect(
ApiOptions apiOptions, ClientOptions clientOptions, Future< NyxxGateway> connect()) → Future<NyxxGateway> -
Perform the connection operation.
inherited
-
fetchInfo(
) → Future< LavalinkInfo> - Fetch information about the Lavalink server.
-
fetchStats(
) → Future< LavalinkStats> - Fetch statistics about the Lavalink server.
-
fetchVersion(
) → Future< String> - Fetch the current version of the Lavalink server.
-
interceptGatewayMessages(
Shard shard, Stream< GatewayMessage> messages) → Stream<GatewayMessage> -
Intercept
GatewayMessage
s by transforming themessages
stream.inherited -
interceptRequest(
NyxxGateway client, HttpRequest request, Future< HttpResponse> next(HttpRequest)) → Future<HttpResponse> -
Called whenever a request is made using a client's
HttpHandler
.inherited -
interceptShardMessages(
Shard shard, Stream< ShardMessage> messages) → Stream<ShardMessage> -
Intercept
ShardMessage
s by transforming themessages
stream.inherited -
loadTrack(
String identifier) → Future< LoadResult> -
Load information about the track or tracks identified by
identifier
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- clientName → const String
- The default client name used when connecting to lavalink.
- version → const String
-
The current version of
nyxx_lavalink
.