Discord Elixir v1.1.18 DiscordEx.Client.Utility View Source

Utilty methods to be used for discord clients.

Normalizers, Encoders, and Decoders

Link to this section Summary

Functions

Generic function for updating the value of an agent process

Generic function for getting the value from an agent process

Convert atom to string

Get the atom value of and opcode using an integer value

Build a binary payload for discord communication

Build a json payload for discord communication

Decode json payload received from discord into a map

Link to this section Functions

Link to this function agent_update(agent, n) View Source
agent_update(pid(), any()) :: nil

Generic function for updating the value of an agent process

Link to this function agent_value(agent) View Source
agent_value(pid()) :: any()

Generic function for getting the value from an agent process

Link to this function normalize_atom(atom) View Source
normalize_atom(atom()) :: String.t()

Convert atom to string

Link to this function opcode(codes, value) View Source
opcode(map(), integer()) :: atom()
opcode(map(), atom()) :: integer()

Get the atom value of and opcode using an integer value

Link to this function payload_build(op, data, seq_num \\ nil, event_name \\ nil) View Source
payload_build(number(), map(), number(), String.t()) :: binary()

Build a binary payload for discord communication

Link to this function payload_build_json(op, data, seq_num \\ nil, event_name \\ nil) View Source
payload_build_json(number(), map(), number(), String.t()) :: binary()

Build a json payload for discord communication

Link to this function payload_decode(codes, arg) View Source
payload_decode(list(), {atom(), binary()}) :: map()
payload_decode(list(), {atom(), binary()}) :: map()

Decode json payload received from discord into a map