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

Safe HaskellNone



Provides framework to interact with REST api gateways. Implementations specific to the Discord API are provided in Network.Discord.Rest.Channel, Network.Discord.Rest.Guild, and Network.Discord.Rest.User.



fetch :: (DoFetch a, Hashable a) => a -> Proxy X () c' c DiscordM Fetched Source #

Perform an API request.

fetch' :: (DoFetch a, Hashable a) => a -> Proxy X () c' c DiscordM () Source #

Perform an API request, ignoring the response

withApi :: Client Fetchable Fetched DiscordM Fetched -> Effect DiscordM () Source #

Alternative method of interacting with the REST api

restServer :: Fetchable -> Server Fetchable Fetched DiscordM Fetched Source #

Provides a pipe to perform REST actions

getGateway :: IO URL Source #

Obtains a new gateway to connect to.

readInteger :: String -> Integer Source #

Read function specialized for Integers

baseURL :: String Source #

The base url for API requests

baseRequest :: DiscordM Options Source #

Construct base request with auth from Discord state

class RateLimit a where Source #

Class for rate-limitable actions

Minimal complete definition

getRateLimit, setRateLimit


getRateLimit :: a -> DiscordM (Maybe Int) Source #

Return seconds to expiration if we're waiting for a rate limit to reset

setRateLimit :: a -> Int -> DiscordM () Source #

Set seconds to the next rate limit reset when we hit a rate limit

waitRateLimit :: a -> DiscordM () Source #

If we hit a rate limit, wait for it to reset

class DoFetch a where Source #

Class over which performing a data retrieval action is defined

Minimal complete definition


data Fetchable Source #

Polymorphic type for all DoFetch types


(DoFetch a, Hashable a) => Fetch a 

data Fetched Source #

Result of a data retrieval action


FromJSON a => SyncFetched a 

data Range Source #

Represents a range of Snowflakes




toQueryString :: Range -> String Source #

Convert a Range to a query string