calamity-0.1.11.0: A library for writing discord bots
Safe HaskellNone
LanguageHaskell2010

Calamity.HTTP

Contents

Description

Combined http request stuff

Synopsis

Documentation

invoke :: (Request a, BotC r, FromJSON (Result a)) => a -> Sem r (Either RestError (Result a)) Source #

data RestError Source #

Instances

Instances details
Show RestError Source # 
Instance details

Defined in Calamity.HTTP.Internal.Types

Generic RestError Source # 
Instance details

Defined in Calamity.HTTP.Internal.Types

Associated Types

type Rep RestError :: Type -> Type #

type Rep RestError Source # 
Instance details

Defined in Calamity.HTTP.Internal.Types

type Rep RestError = D1 ('MetaData "RestError" "Calamity.HTTP.Internal.Types" "calamity-0.1.11.0-inplace" 'False) (C1 ('MetaCons "HTTPError" 'PrefixI 'True) (S1 ('MetaSel ('Just "status") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "response") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Value))) :+: C1 ('MetaCons "DecodeError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

HTTP

This module contains all the http related things

Registered Metrics

  1. Gauge: "inflight_requests" [route]

    Keeps track of how many requests are currently in-flight, the route parameter will be the route that is currently active.

  1. Counter: "total_requests" [route]

    Incremented on every request, the route parameter is the route that the request was made on.

Examples

Editing a message:

invoke $ EditMessage someChannel someMessage (Just "new content") Nothing