Crux vdev Crux.Gateway.Command View Source
Builds Gateway Commands.
Note: Only the sent ones can be found here.
A list of available op codes:
Link to this section Summary
Link to this section Types
activity() View Source
Used to set an activity via
:type must be a valid Activity Type
Note that streaming requires a twitch url pointing to a possible channel!
Encoded command ready to be sent to the gateway via
If you want to build custom commands,
:erlang.term_to_binary/1 a map with the keys
and wrap it in a tuple with
:binary as first element.
Link to this section Functions
Builds a Heartbeat command.
Used to signalize the server that the client is still alive and able to receive messages.
identify(args) View Source
Builds an Identify command.
Used to identify the gateway connection and "log in".
request_guild_members(guild_id, opts \\ ) View Source
Builds a Request Guild Members command.
Used to request guild member for a specific guild.
Note: This must be sent to the connection handling the guild, not just any connection.
The gateway will respond with
:GUILD_MEMBER_CHUNK packets until all appropriate members are received.
resume(map) View Source
Builds a Resume command.
Used to resume into a session which was unexpectly disconnected and may be resumable.
status_update(status, game \\ nil) View Source
Builds a Status Update command.
Used to update the status of the client, including activity.
voice_state_update(guild_id, channel_id \\ nil, states \\ ) View Source
Builds a Voice State Update command.
Used to join, switch between, and leave voice channels and/or change self_mute or self_deaf states.