glyde/gateway/presence
What the bot looks like in a member list: the dot next to its name and the line under it.
Its own module because two frames carry the same object: op 3 sends one on
its own, and IDENTIFY carries the one to connect with. gateway/command
and gateway/frame both need it, and frame cannot import command.
Types
The line under the bot’s name. A bot may set only name, type, URL and state.
pub type Activity {
Playing(name: String)
Streaming(name: String, url: String)
Listening(name: String)
Watching(name: String)
Competing(name: String)
CustomStatus(text: String)
}
Constructors
-
Playing(name: String)“Playing {name}”.
-
Streaming(name: String, url: String)“Streaming {name}”. Discord checks the URL and only twitch.tv and youtube.com links work.
-
Listening(name: String)“Listening to {name}”.
-
Watching(name: String)“Watching {name}”.
-
Competing(name: String)“Competing in {name}”.
-
CustomStatus(text: String)Just the text, with no verb in front of it.
The dot next to the bot’s name.
pub type Status {
Online
Idle(since: option.Option(Int))
DoNotDisturb
Invisible
Offline
}
Constructors
-
Online -
Idle(since: option.Option(Int))sinceis the unix milliseconds the bot went idle. It hangs off this variant because Discord’ssinceis null for every other status, so there is no second place it could come from. -
DoNotDisturb -
Invisible -
OfflineFor a bot this looks the same to everyone else as
Invisible.