Safe Haskell | None |
---|---|
Language | Haskell2010 |
Provides logic code for interacting with the Discord websocket gateway. Reallistically, this is probably lower level than most people will need, and you should use Language.Discord.
- makeWebsocketSource :: (FromJSON a, MonadIO m) => Connection -> Producer a m ()
- runWebsocket :: Client c => URL -> c -> Effect DiscordM a -> IO a
- heartbeat :: Int -> Connection -> TMVar Integer -> IO ()
- makeEvents :: Pipe Payload Event DiscordM a
- eventCore :: Connection -> Producer Event DiscordM ()
Documentation
makeWebsocketSource :: (FromJSON a, MonadIO m) => Connection -> Producer a m () Source #
Turn a websocket Connection into a Pipes Producer (data source)
runWebsocket :: Client c => URL -> c -> Effect DiscordM a -> IO a Source #
Starts a websocket connection that allows you to handle Discord events.
makeEvents :: Pipe Payload Event DiscordM a Source #
Turn a websocket data source into an Event
data
source
eventCore :: Connection -> Producer Event DiscordM () Source #
Utility function providing core functionality by converting a Websocket
Connection
to a stream of gateway Event
s