discord_gleam/ws/event_loop

Event loop for handling the discord gateway websocket Dispatches events to registered event handlers

Types

pub type State {
  State(has_received_hello: Bool, s: Int)
}

Constructors

  • State(has_received_hello: Bool, s: Int)

Functions

pub fn main(
  bot: Bot,
  event_handlers: List(fn(Bot, Packet) -> Nil),
  host: String,
  reconnect: Bool,
  session_id: String,
  state_uset: USet(#(String, String)),
) -> Nil

Start the event loop, with a set of event handlers.

Search Document