calamity-0.3.0.0: A library for writing discord bots in haskell
Safe HaskellNone
LanguageHaskell2010

Calamity.Interactions.Utils

Description

Interaction related utilities

Synopsis

Documentation

respond :: forall t r. (Members '[InteractionEff, RatelimitEff, TokenEff, LogEff, MetricEff, Embed IO] r, ToMessage t) => t -> Sem r (Either RestError ()) Source #

Respond to an interaction with a globally visible message

respondEphemeral :: forall t r. (Members '[InteractionEff, RatelimitEff, TokenEff, LogEff, MetricEff, Embed IO] r, ToMessage t) => t -> Sem r (Either RestError ()) Source #

Respond to an interaction with an ephemeral message

followUp :: forall t r. (Members '[InteractionEff, RatelimitEff, TokenEff, LogEff, MetricEff, Embed IO] r, ToMessage t) => t -> Sem r (Either RestError ()) Source #

Create a follow up response to an interaction

followUpEphemeral :: forall t r. (Members '[InteractionEff, RatelimitEff, TokenEff, LogEff, MetricEff, Embed IO] r, ToMessage t) => t -> Sem r (Either RestError ()) Source #

Create an ephemeral follow up response to an interaction

edit :: forall t r. (Members '[InteractionEff, RatelimitEff, TokenEff, LogEff, MetricEff, Embed IO] r, ToMessage t) => t -> Sem r (Either RestError ()) Source #

Respond to an interaction by editing the message that triggered the interaction

defer :: Members '[InteractionEff, RatelimitEff, TokenEff, LogEff, MetricEff, Embed IO] r => Sem r (Either RestError ()) Source #

Defer an interaction and show a loading state, use followUp later on

deferEphemeral :: Members '[InteractionEff, RatelimitEff, TokenEff, LogEff, MetricEff, Embed IO] r => Sem r (Either RestError ()) Source #

Defer an interaction and show an ephemeral loading state, use followUp later on

pushModal :: Members '[InteractionEff, RatelimitEff, TokenEff, LogEff, MetricEff, Embed IO] r => Text -> [Component] -> Sem r (Either RestError ()) Source #

Push a modal as a response to an interaction

You should probably use this with runView

userLocalState Source #

Arguments

:: forall r s a. Member InteractionEff r 
=> s

Initial state

-> Sem (State s ': r) a 
-> Sem r a 

Provide local state semantics to a running view, the state is keyed to the user invoking the interaction