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

Safe HaskellNone




data Gateway Source #

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

data ThreadIdType Source #

Thread Ids marked by what type they are

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

Execute one http request and get a response

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

Block until the gateway produces another event. Once an exception is returned, only return that exception

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

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

readCache :: (RestChan, Gateway, z) -> IO (Either GatewayException 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