| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Calamity.Interactions
Contents
Description
Calamity Interaction views
Synopsis
- module Calamity.Interactions.View
- module Calamity.Interactions.Utils
- module Calamity.Interactions.Eff
Documentation
module Calamity.Interactions.View
module Calamity.Interactions.Utils
module Calamity.Interactions.Eff
Interactions and Views
This module contains functions and types related to handling discord interactions.
The data models for components can be found in Calamity.Types.Model.Channel.Component
Examples
Displaying a View
let view =row$ do a <-buttonButtonPrimary"defer" b <-buttonButtonPrimary"deferEph" c <-buttonButtonPrimary"deferComp" d <-buttonButtonPrimary"modal" pure (a, b, c, d) modalView = do a <-textInputTextInputShort"a" b <-textInputTextInputParagraph"b" pure (a, b) inrunViewview (tellctx) $ \(a, b, c, d) -> dowhena $ dovoiddeferembed$ threadDelay 1000000void$followUp@Text"lol"whenb $ dovoiddeferEphemeralembed$ threadDelay 1000000void$followUpEphemeral@Text"lol"whenc $ dovoiddeferComponentembed$ threadDelay 1000000void$followUp@Text"lol"whend $ dovoid.async$ dorunViewmodalView (void.pushModal"lol") $ (a, b) -> doembed$ print (a, b)void$respond("Thanks: " <> a <> " " <> b)endView() pure ()