package gateway
- Source
- gateway.scala
- Alphabetic
- By Inheritance
- gateway
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- sealed trait Compress extends AnyRef
- case class Dispatch[+D](sequence: Int, event: GatewayEvent[D], gatewayInfo: GatewayInfo) extends ServerGatewayMessage[D] with Product with Serializable
Sent with each new event.
Sent with each new event.
- sequence
The seq number.
- event
The sent event.
- sealed trait EagerGatewayMessage[D] extends GatewayMessage[D]
- sealed trait GatewayEvent[+D] extends AnyRef
Base trait for all gateway events.
Base trait for all gateway events.
- D
The data this event carries.
- class GatewayHandlerGraphStage extends GraphStageWithMaterializedValue[FlowShape[GatewayMessage[_], GatewayMessage[_]], (Future[(Option[ResumeData], Boolean)], Future[Unit])]
- case class GatewayInfo(shardInfo: ShardInfo, currentSeq: Int) extends Product with Serializable
- currentSeq
The current seq number when this message was received. Will be -1 if no seq has been received yet.
- type GatewayIntents = gateway.GatewayIntents.GatewayIntents
- implicit final class GatewayIntentsSyntax extends AnyVal
- class GatewayJsonException extends Exception
- sealed trait GatewayMessage[+D] extends AnyRef
Base trait for all gateway messages.
- sealed abstract class GatewayOpCode extends IntEnumEntry
All the different opcodes used by the gateway.
- class GatewayRatelimitedException extends Exception
- case class GatewaySettings(token: String, largeThreshold: Int = 50, shardNum: Int = 0, shardTotal: Int = 1, idleSince: Option[Instant] = None, activities: Seq[RawActivity] = Nil, status: PresenceStatus = PresenceStatus.Online, afk: Boolean = false, intents: GatewayIntents = GatewayIntents.AllNonPrivileged, compress: Compress = Compress.ZLibStreamCompress, eventDecoders: EventDecoders = GatewayProtocol.ackcordEventDecoders, restartBackoff: () => FiniteDuration = () => 5.minutes) extends Product with Serializable
All the settings used by AckCord when connecting and similar
All the settings used by AckCord when connecting and similar
- token
The token for the bot
- largeThreshold
The large threshold
- shardNum
The shard index of this
- shardTotal
The amount of shards
- idleSince
If the bot has been idle, set the time since
- activities
Send an activity when connecting
- status
The status to use when connecting
- afk
If the bot should be afk when connecting
- intents
Sets which events the gateway should send to the bot.
- case class Heartbeat(nowD: Option[Int], gatewayInfo: GatewayInfo) extends EagerGatewayMessage[Option[Int]] with ServerGatewayMessage[Option[Int]] with Product with Serializable
Sent and received to confirm the connection is still going.
Sent and received to confirm the connection is still going.
- nowD
The previous sequence.
- case class HeartbeatACK(gatewayInfo: GatewayInfo) extends EagerGatewayMessage[Unit] with ServerGatewayMessage[Unit] with Product with Serializable
Sent by the gateway as a response to Heartbeat.
- case class Hello(nowD: HelloData, gatewayInfo: GatewayInfo) extends EagerGatewayMessage[HelloData] with ServerGatewayMessage[HelloData] with Product with Serializable
Sent by the gateway as a response to Identify
- case class HelloData(heartbeatInterval: Int) extends Product with Serializable
- heartbeatInterval
The amount of milliseconds inbetween the time to send a heartbeat.
- case class Identify(nowD: IdentifyData) extends EagerGatewayMessage[IdentifyData] with Product with Serializable
Sent by the shard to log in.
- case class IdentifyData(token: String, properties: Map[String, String], compress: Boolean, largeThreshold: Int, shard: Seq[Int], presence: PresenceData, intents: GatewayIntents) extends Product with Serializable
- token
The bot token.
- properties
A map of properties to send.
- compress
If compressed messages should be used.
- largeThreshold
The threshold where the gateway stops sending offline users.
- shard
The shard info, the first index is the shard id, while the second is the total amount of shards.
- presence
The presence data to start with.
- case class InvalidSession(resumable: Boolean, gatewayInfo: GatewayInfo) extends EagerGatewayMessage[Boolean] with ServerGatewayMessage[Boolean] with Product with Serializable
Sent by the gateway if the session is invalid when resuming a connection.
Sent by the gateway if the session is invalid when resuming a connection.
- resumable
If the connection is resumable.
- case class PresenceData(since: Option[Instant], activities: Seq[RawActivity], status: PresenceStatus, afk: Boolean) extends Product with Serializable
- since
If present, instant when the user went idle.
- activities
The presence activities.
- status
The status of the user.
- afk
If the user is AFK.
- case class PresenceUpdate(nowD: PresenceData, gatewayInfo: GatewayInfo) extends EagerGatewayMessage[PresenceData] with ServerGatewayMessage[PresenceData] with Product with Serializable
Sent when a presence changes.
- case class Reconnect(gatewayInfo: GatewayInfo) extends EagerGatewayMessage[Unit] with ServerGatewayMessage[Unit] with Product with Serializable
Sent by the gateway to indicate that the shard should reconnect.
- case class RequestGuildMembers(nowD: RequestGuildMembersData) extends EagerGatewayMessage[RequestGuildMembersData] with Product with Serializable
Sent by the shard to receive all the members of a guild, even logged out ones.
- case class RequestGuildMembersData(guildId: GuildId, query: Option[String] = None, limit: Option[Int] = None, presences: Boolean = false, userIds: Option[Seq[UserId]], nonce: Option[String]) extends Product with Serializable
- guildId
The guildId(s) to request for.
- query
Return all the users where their username start with this. or an empty string for all users.
- limit
The amount of users to send, or 0 for all users.
- presences
If the presences of the users should be sent too.
- userIds
Users to fetch.
- case class Resume(nowD: ResumeData, gatewayInfo: GatewayInfo) extends EagerGatewayMessage[ResumeData] with ServerGatewayMessage[ResumeData] with Product with Serializable
Sent by the shard instead of Identify when resuming a connection.
- case class ResumeData(token: String, sessionId: String, seq: Int) extends Product with Serializable
- token
The bot token.
- sessionId
The sessionId received earlier.
- seq
The last seq received.
- sealed trait ServerGatewayMessage[+D] extends GatewayMessage[D]
- case class ShardInfo(maxShards: Int, shardNum: Int) extends Product with Serializable
- maxShards
The maximum amount of shards that was specified when this connection was established.
- shardNum
The shard this message belongs to.
- case class UnknownGatewayMessage(op: GatewayOpCode, gatewayInfo: GatewayInfo) extends EagerGatewayMessage[Unit] with ServerGatewayMessage[Unit] with Product with Serializable
All unknown gateway messages.
- case class VoiceServerUpdate(nowD: VoiceServerUpdateData, gatewayInfo: GatewayInfo) extends EagerGatewayMessage[VoiceServerUpdateData] with ServerGatewayMessage[VoiceServerUpdateData] with Product with Serializable
- case class VoiceServerUpdateData(token: String, guildId: GuildId, endpoint: String) extends Product with Serializable
- token
The voice connection token.
- guildId
The guild of the update.
- endpoint
The voice server.
- case class VoiceStateUpdate(nowD: VoiceStateUpdateData) extends EagerGatewayMessage[VoiceStateUpdateData] with Product with Serializable
Sent by the bot to connect to a voice channel.
- case class VoiceStateUpdateData(guildId: GuildId, channelId: Option[VoiceGuildChannelId], selfMute: Boolean, selfDeaf: Boolean) extends Product with Serializable
- guildId
The channel the voice channel is in.
- channelId
The voice channel to join.
- selfMute
If the bot should mute itself.
- selfDeaf
If the bot should deafen itself.
Value Members
- object Compress
- object GatewayEvent
- object GatewayHandler
- object GatewayHandlerGraphStage
- object GatewayIntents
- object GatewayOpCode extends IntEnum[GatewayOpCode] with IntCirceEnumWithUnknown[GatewayOpCode]
- object GatewayProtocol extends DiscordProtocol
- object IdentifyData extends Serializable