discord-hs-0.1.3: An API wrapper for Discord in Haskell

Safe HaskellNone
LanguageHaskell2010

Network.Discord.Gateway

Description

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.

Synopsis

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.

heartbeat :: Int -> Connection -> TMVar Integer -> IO () Source #

Spawn a heartbeat thread

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 Events