discord-haskell-1.16.0: Write bots for Discord in Haskell
Safe HaskellSafe-Inferred
LanguageHaskell2010

Discord.Internal.Rest.Prelude

Description

Utility and base types and functions for the Discord Rest API

Synopsis

Documentation

apiVersion :: Text Source #

The api version to use.

baseUrl :: Url 'Https Source #

The base url (Req) for API requests

authHeader :: Auth -> Option 'Https Source #

Discord requires HTTP headers for authentication.

(/?) :: ToHttpApiData a => Url scheme -> Maybe a -> Url scheme infixl 5 Source #

data JsonRequest where Source #

A compiled HTTP request ready to execute

class Request a where Source #

Methods

majorRoute :: a -> String Source #

used for putting a request into a rate limit bucket https://discord.com/developers/docs/topics/rate-limits#rate-limits

jsonRequest :: a -> JsonRequest Source #

build a JSON http request

Instances

Instances details
Request (ApplicationCommandRequest a) Source # 
Instance details

Defined in Discord.Internal.Rest.ApplicationCommands

Request (FullApplicationRequest a) Source # 
Instance details

Defined in Discord.Internal.Rest.ApplicationInfo

Request (ChannelRequest a) Source # 
Instance details

Defined in Discord.Internal.Rest.Channel

Request (EmojiRequest a) Source # 
Instance details

Defined in Discord.Internal.Rest.Emoji

Request (StickerRequest a) Source # 
Instance details

Defined in Discord.Internal.Rest.Emoji

Request (GuildRequest a) Source # 
Instance details

Defined in Discord.Internal.Rest.Guild

Request (InteractionResponseRequest a) Source # 
Instance details

Defined in Discord.Internal.Rest.Interactions

Request (InviteRequest a) Source # 
Instance details

Defined in Discord.Internal.Rest.Invite

Request (ScheduledEventRequest a) Source # 
Instance details

Defined in Discord.Internal.Rest.ScheduledEvents

Request (UserRequest a) Source # 
Instance details

Defined in Discord.Internal.Rest.User

Request (VoiceRequest a) Source # 
Instance details

Defined in Discord.Internal.Rest.Voice

Request (WebhookRequest a) Source # 
Instance details

Defined in Discord.Internal.Rest.Webhook

newtype RestIO a Source #

Same Monad as IO. Overwrite Req settings

Constructors

RestIO 

Fields

Instances

Instances details
MonadIO RestIO Source # 
Instance details

Defined in Discord.Internal.Rest.Prelude

Methods

liftIO :: IO a -> RestIO a #

Applicative RestIO Source # 
Instance details

Defined in Discord.Internal.Rest.Prelude

Methods

pure :: a -> RestIO a #

(<*>) :: RestIO (a -> b) -> RestIO a -> RestIO b #

liftA2 :: (a -> b -> c) -> RestIO a -> RestIO b -> RestIO c #

(*>) :: RestIO a -> RestIO b -> RestIO b #

(<*) :: RestIO a -> RestIO b -> RestIO a #

Functor RestIO Source # 
Instance details

Defined in Discord.Internal.Rest.Prelude

Methods

fmap :: (a -> b) -> RestIO a -> RestIO b #

(<$) :: a -> RestIO b -> RestIO a #

Monad RestIO Source # 
Instance details

Defined in Discord.Internal.Rest.Prelude

Methods

(>>=) :: RestIO a -> (a -> RestIO b) -> RestIO b #

(>>) :: RestIO a -> RestIO b -> RestIO b #

return :: a -> RestIO a #

MonadHttp RestIO Source # 
Instance details

Defined in Discord.Internal.Rest.Prelude