Safe Haskell | None |
---|---|
Language | Haskell2010 |
- module Discord.Types
- module Discord.Rest.Channel
- module Discord.Rest.Guild
- module Discord.Rest.User
- module Discord.Rest.Emoji
- data Cache = Cache {}
- data Gateway = Gateway {}
- newtype RestChan = RestChan (Chan (String, JsonRequest, MVar (Either String ByteString)))
- class Request a where
- restCall :: (FromJSON a, Request (r a)) => (RestChan, y, z) -> r a -> IO (Either String a)
- nextEvent :: (x, Gateway, z) -> IO Event
- sendCommand :: (x, Gateway, z) -> GatewaySendable -> IO ()
- readCache :: (RestChan, Gateway, z) -> IO Cache
- stopDiscord :: (x, y, [ThreadIdType]) -> IO ()
- loginRest :: Auth -> IO (RestChan, NotLoggedIntoGateway, [ThreadIdType])
- loginRestGateway :: Auth -> IO (RestChan, Gateway, [ThreadIdType])
Documentation
module Discord.Types
module Discord.Rest.Channel
module Discord.Rest.Guild
module Discord.Rest.User
module Discord.Rest.Emoji
Concurrency primitives that make up the gateway. Build a higher level interface over these
class Request a where Source #
majorRoute :: a -> String Source #
jsonRequest :: a -> JsonRequest Source #
Request (UserRequest a) Source # | |
Request (GuildRequest a) Source # | |
Request (EmojiRequest a) Source # | |
Request (ChannelRequest a) Source # | |
restCall :: (FromJSON a, Request (r a)) => (RestChan, y, z) -> r a -> IO (Either String a) Source #
Execute one http request and get a response
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