Safe Haskell | None |
---|---|
Language | Haskell2010 |
Provides logic code for interacting with the Discord websocket gateway. Realistically, this is probably lower level than most people will need
Synopsis
- data GatewayHandle = GatewayHandle {}
- data GatewayException
- data LoopState
- data SendablesData = SendablesData {}
- connectionLoop :: Auth -> GatewayIntent -> GatewayHandle -> Chan Text -> IO ()
- runEventLoop :: GatewayHandle -> SendablesData -> Chan Text -> IO LoopState
- heartbeat :: SendablesData -> IORef Integer -> IO ()
- getPayloadTimeout :: SendablesData -> Chan Text -> IO (Either ConnectionException GatewayReceivable)
- getPayload :: Connection -> Chan Text -> IO (Either ConnectionException GatewayReceivable)
- sendableLoop :: Connection -> GatewayHandle -> SendablesData -> Chan Text -> IO ()
Documentation
data GatewayHandle 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 # |
State of the eventloop
data SendablesData Source #
Enough info for library to send info to discord.
connectionLoop :: Auth -> GatewayIntent -> GatewayHandle -> Chan Text -> IO () Source #
runEventLoop :: GatewayHandle -> SendablesData -> Chan Text -> IO LoopState Source #
getPayloadTimeout :: SendablesData -> Chan Text -> IO (Either ConnectionException GatewayReceivable) Source #
getPayload :: Connection -> Chan Text -> IO (Either ConnectionException GatewayReceivable) Source #
sendableLoop :: Connection -> GatewayHandle -> SendablesData -> Chan Text -> IO () Source #