GuildJoins class

Provides a way to know when the client joins or leaves a Guild.

NyxxGateway.onGuildCreate and NyxxGateway.onGuildDelete can be misleading, as although they do emit an event when the client is added to or removed from a Guild, they can also emit events in a variety of other scenarios:

  • When guilds become available or unavailable due to outages
  • As part of session initialisation, to populate the cache with information about the guild contained in the ReadyEvent.

This plugin exposes two streams. onGuildJoin and onGuildLeave, that emit the same type of events as NyxxGateway.onGuildCreate and NyxxGateway.onGuildDelete, but only when the event is triggered by the client joining or leaving a guild.

Constructors

GuildJoins()

Properties

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
onGuildJoin Stream<UnavailableGuildCreateEvent>
A stream of UnavailableGuildCreateEvent triggered by the client being added to a Guild.
no setter
onGuildLeave Stream<GuildDeleteEvent>
A stream of GuildDeleteEvents triggered by the client being removed from a Guild.
no setter
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
createState() → NyxxPluginState<NyxxGateway, GuildJoins>
Called to create the state for this plugin.
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
interceptGatewayMessages(Shard shard, Stream<GatewayMessage> messages) Stream<GatewayMessage>
Intercept GatewayMessages by transforming the messages 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 ShardMessages by transforming the messages stream.
inherited
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