Safe Haskell | None |
---|---|
Language | Haskell2010 |
Provides a rather raw interface to the websocket events through a real-time Chan
Synopsis
- type DiscordHandleGateway = (Chan (Either GatewayException Event), Chan GatewaySendable, IORef (Maybe UpdateStatusOpts))
- type DiscordHandleCache = (Chan (Either GatewayException Event), MVar (Either (Cache, GatewayException) Cache))
- data GatewayException
- data Cache = Cache {}
- startCacheThread :: Chan Text -> IO (DiscordHandleCache, ThreadId)
- startGatewayThread :: Auth -> DiscordHandleCache -> Chan Text -> IO (DiscordHandleGateway, ThreadId)
- data Auth
- data Event
- data GatewaySendable
Documentation
type DiscordHandleGateway = (Chan (Either GatewayException Event), Chan GatewaySendable, IORef (Maybe UpdateStatusOpts)) Source #
type DiscordHandleCache = (Chan (Either GatewayException Event), MVar (Either (Cache, GatewayException) Cache)) Source #
data GatewayException Source #
GatewayExceptionCouldNotConnect Text | |
GatewayExceptionEventParseError Text Text | |
GatewayExceptionUnexpected GatewayReceivable Text | |
GatewayExceptionConnection ConnectionException Text |
Instances
Show GatewayException Source # | |
Defined in Discord.Internal.Gateway.EventLoop showsPrec :: Int -> GatewayException -> ShowS # show :: GatewayException -> String # showList :: [GatewayException] -> ShowS # |
startCacheThread :: Chan Text -> IO (DiscordHandleCache, ThreadId) Source #
startGatewayThread :: Auth -> DiscordHandleCache -> Chan Text -> IO (DiscordHandleGateway, ThreadId) Source #
Create a Chan for websockets. This creates a thread that writes all the received Events to the Chan
Authorization token for the Discord API
Represents possible events sent by discord. Detailed information can be found at https://discord.com/developers/docs/topics/gateway.
data GatewaySendable Source #