discord-haskell-0.5.1: Write bots for Discord in Haskell

Safe HaskellNone
LanguageHaskell2010

Discord

Synopsis

Documentation

data Gateway Source #

Concurrency primitives that make up the gateway. Build a higher level interface over these

restCall :: (FromJSON a, Request (r a)) => (RestChan, y, z) -> r a -> IO (Either String a) Source #

Execute one http request and get a response

nextEvent :: (x, Gateway, z) -> IO Event Source #

Block until the gateway produces another event

sendCommand :: (x, Gateway, z) -> GatewaySendable -> IO () Source #

Send a GatewaySendable, but not Heartbeat, Identify, or Resume

readCache :: (RestChan, Gateway, z) -> IO Cache Source #

Access the current state of the gateway cache

stopDiscord :: (x, y, [ThreadIdType]) -> IO () Source #

Stop all the background threads

loginRest :: Auth -> IO (RestChan, NotLoggedIntoGateway, [ThreadIdType]) Source #

Start HTTP rest handler background threads

loginRestGateway :: Auth -> IO (RestChan, Gateway, [ThreadIdType]) Source #

Start HTTP rest handler and gateway background threads