pub enum ShardRunnerMessage {
Restart(ShardId),
Shutdown(ShardId, u16),
ChunkGuild {
guild_id: GuildId,
limit: Option<u16>,
presences: bool,
filter: ChunkGuildFilter,
nonce: Option<String>,
},
Close(u16, Option<String>),
Message(Message),
SetActivity(Option<ActivityData>),
SetPresence(Option<ActivityData>, OnlineStatus),
SetStatus(OnlineStatus),
}
Expand description
A message to send from a shard over a WebSocket.
Variants§
Restart(ShardId)
Indicator that a shard should be restarted.
Shutdown(ShardId, u16)
Indicator that a shard should be fully shutdown without bringing it back up.
ChunkGuild
Indicates that the client is to send a member chunk message.
Fields
limit: Option<u16>
The maximum number of members to receive GuildMembersChunkEvent
s for.
presences: bool
Used to specify if we want the presences of the matched members.
Requires crate::model::gateway::GatewayIntents::GUILD_PRESENCES
.
filter: ChunkGuildFilter
A filter to apply to the returned members.
nonce: Option<String>
Optional nonce to identify GuildMembersChunkEvent
responses.
Close(u16, Option<String>)
Indicates that the client is to close with the given status code and reason.
You should rarely - if ever - need this, but the option is available. Prefer to use the
ShardManager
to shutdown WebSocket clients if you are intending to send a 1000 close
code.
Message(Message)
Indicates that the client is to send a custom WebSocket message.
SetActivity(Option<ActivityData>)
Indicates that the client is to update the shard’s presence’s activity.
SetPresence(Option<ActivityData>, OnlineStatus)
Indicates that the client is to update the shard’s presence in its entirety.
SetStatus(OnlineStatus)
Indicates that the client is to update the shard’s presence’s status.