Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Module containing the core client stuff
Synopsis
- module Calamity.Client.Client
- module Calamity.Client.Types
Documentation
module Calamity.Client.Client
module Calamity.Client.Types
Client stuff
This module provides the core components for running a discord client, along with abstractions for registering event handlers, firing custom events, and waiting on events.
Registered Metrics
Counter:
"events_recieved" [type, shard]
Incremented for each event received, the
type
parameter is the type of event (the name of the constructor inDispatchData
), andshard
is the ID of the shard that received the event.
Histogram:
"cache_update"
Tracks how long it takes to update the cache after recieving an event.
Histogram:
"event_handle"
Tracks how long it takes to process an event handler for an event.
Examples
A simple client that prints every message recieved:
void
.runFinal
.embedToFinal
.runCacheInMemory
.runMetricsNoop
$runBotIO
(BotToken
token) $ doreact
@'MessageCreateEvt
$ \msg ->embed
$