slack-web-1.5.0.0: Bindings for the Slack web API
Safe HaskellSafe-Inferred
LanguageHaskell2010

Web.Slack.Experimental.Blocks.Types

Synopsis

Documentation

class Slack a where Source #

Class of types that can be turned into part of a Slack Message. message is the primary way of converting primitive and domain-level types into things that can be shown in a slack message.

Methods

message :: a -> SlackText Source #

Instances

Instances details
Slack SlackButtonText Source # 
Instance details

Defined in Web.Slack.Experimental.Blocks.Types

Slack Text Source # 
Instance details

Defined in Web.Slack.Experimental.Blocks.Types

Slack String Source # 
Instance details

Defined in Web.Slack.Experimental.Blocks.Types

Slack Int Source # 
Instance details

Defined in Web.Slack.Experimental.Blocks.Types

link :: Text -> Maybe Text -> SlackText Source #

Render a link with optional link text

plaintextonly :: Slack a => a -> SlackPlainTextOnly Source #

Create a SlackPlainTextOnly. Some API points can can take either markdown or plain text, but some can take only plain text. This enforces the latter.

plaintext :: Slack a => a -> SlackTextObject Source #

Create a plain text SlackTextObject where the API allows either markdown or plain text.

mrkdwn :: Slack a => a -> SlackTextObject Source #

Create a markdown SlackTextObject where the API allows either markdown or plain text.

newtype OptionalSetting a Source #

Represents an optional setting for some Slack Setting.

Constructors

OptionalSetting 

Instances

Instances details
IsString (OptionalSetting Text) Source #

Allows using bare Texts without having to use setting

Instance details

Defined in Web.Slack.Experimental.Blocks.Types

IsString (OptionalSetting String) Source #

Allows using bare Strings without having to use setting

Instance details

Defined in Web.Slack.Experimental.Blocks.Types

Eq a => Eq (OptionalSetting a) Source # 
Instance details

Defined in Web.Slack.Experimental.Blocks.Types

setting :: a -> OptionalSetting a Source #

Sets a setting.

emptySetting :: OptionalSetting a Source #

Sets the empty setting.

data SlackStyle Source #

Styles for Slack buttons. If no style is given, the default style (black) is used.

Constructors

SlackStylePrimary

Green button

SlackStyleDanger

Red button

newtype SlackActionId Source #

Used to identify an action. The ID used should be unique among all actions in the block.

This is limited to 255 characters, per the Slack documentation at https://api.slack.com/reference/block-kit/block-elements#button

Constructors

SlackActionId 

data SlackImage Source #

Constructors

SlackImage 

Fields

Instances

Instances details
Show SlackImage Source # 
Instance details

Defined in Web.Slack.Experimental.Blocks.Types

Eq SlackImage Source # 
Instance details

Defined in Web.Slack.Experimental.Blocks.Types

newtype SlackContext Source #

Constructors

SlackContext [SlackContent] 

Instances

Instances details
FromJSON SlackContext Source # 
Instance details

Defined in Web.Slack.Experimental.Blocks.Types

ToJSON SlackContext Source # 
Instance details

Defined in Web.Slack.Experimental.Blocks.Types

Monoid SlackContext Source # 
Instance details

Defined in Web.Slack.Experimental.Blocks.Types

Semigroup SlackContext Source # 
Instance details

Defined in Web.Slack.Experimental.Blocks.Types

Show SlackContext Source # 
Instance details

Defined in Web.Slack.Experimental.Blocks.Types

Eq SlackContext Source # 
Instance details

Defined in Web.Slack.Experimental.Blocks.Types

Image SlackContext Source # 
Instance details

Defined in Web.Slack.Experimental.Blocks.Types

Markdown SlackContext Source # 
Instance details

Defined in Web.Slack.Experimental.Blocks.Types

data RichStyle Source #

A rich text style. You can't actually send these, for some reason.

Constructors

RichStyle 

Fields

data RichLinkAttrs Source #

Constructors

RichLinkAttrs 

Fields

sectionWithButtonAccessory :: SlackAction -> SlackText -> SlackBlock Source #

Small helper function for constructing a section with a button accessory out of a button and text components

newtype SlackMessage Source #

Constructors

SlackMessage [SlackBlock] 

Instances

Instances details
FromJSON SlackMessage Source # 
Instance details

Defined in Web.Slack.Experimental.Blocks.Types

ToJSON SlackMessage Source # 
Instance details

Defined in Web.Slack.Experimental.Blocks.Types

Monoid SlackMessage Source # 
Instance details

Defined in Web.Slack.Experimental.Blocks.Types

Semigroup SlackMessage Source # 
Instance details

Defined in Web.Slack.Experimental.Blocks.Types

Show SlackMessage Source # 
Instance details

Defined in Web.Slack.Experimental.Blocks.Types

Eq SlackMessage Source # 
Instance details

Defined in Web.Slack.Experimental.Blocks.Types

Image SlackMessage Source # 
Instance details

Defined in Web.Slack.Experimental.Blocks.Types

Markdown SlackMessage Source # 
Instance details

Defined in Web.Slack.Experimental.Blocks.Types

class Markdown a where Source #

Methods

markdown :: SlackText -> a Source #

class Image a where Source #

Methods

image :: SlackImage -> a Source #

Instances

Instances details
Image SlackContext Source # 
Instance details

Defined in Web.Slack.Experimental.Blocks.Types

Image SlackMessage Source # 
Instance details

Defined in Web.Slack.Experimental.Blocks.Types

actions :: ToSlackActionList as => as -> SlackMessage Source #

Generates interactive components such as buttons.

actionsWithBlockId :: ToSlackActionList as => SlackBlockId -> as -> SlackMessage Source #

Generates interactive components such as buttons with a SlackBlockId.

data ButtonSettings Source #

Settings for button elements.

Constructors

ButtonSettings 

Fields

buttonSettings :: ButtonSettings Source #

Default button settings.

data ConfirmSettings Source #

Constructors

ConfirmSettings 

Fields

confirmAreYouSure :: ConfirmSettings Source #

Default settings for a "Are you sure?" confirmation dialog.

confirm :: ConfirmSettings -> SlackConfirmObject Source #

Confirm dialog builder.

type SlackBlockId = NonEmptyText 255 Source #

SlackBlockId should be unique for each message and each iteration of a message. If a message is updated, use a new block_id.

data SlackAction Source #

All Slack Actions must have a SlackActionId and one SlackActionComponent (such as a button).

Instances

Instances details
FromJSON SlackAction Source # 
Instance details

Defined in Web.Slack.Experimental.Blocks.Types

ToJSON SlackAction Source # 
Instance details

Defined in Web.Slack.Experimental.Blocks.Types

Show SlackAction Source # 
Instance details

Defined in Web.Slack.Experimental.Blocks.Types

Eq SlackAction Source # 
Instance details

Defined in Web.Slack.Experimental.Blocks.Types

ToSlackActionList SlackAction Source # 
Instance details

Defined in Web.Slack.Experimental.Blocks.Types

ToSlackActionList (SlackAction, SlackAction) Source # 
Instance details

Defined in Web.Slack.Experimental.Blocks.Types

ToSlackActionList (SlackAction, SlackAction, SlackAction) Source # 
Instance details

Defined in Web.Slack.Experimental.Blocks.Types

ToSlackActionList (SlackAction, SlackAction, SlackAction, SlackAction) Source # 
Instance details

Defined in Web.Slack.Experimental.Blocks.Types

ToSlackActionList (SlackAction, SlackAction, SlackAction, SlackAction, SlackAction) Source # 
Instance details

Defined in Web.Slack.Experimental.Blocks.Types

data SlackInteractiveResponse Source #

Type of message to send in response to an interactive webhook. See Slack's Handling user interaction in your Slack apps for a description of these fieldds.

Constructors

SlackInteractiveResponse SlackMessage

Respond with a new message.

Ephemeral SlackMessage

Respond with a message that only the interacting user can usee.

ReplaceOriginal SlackMessage

Replace the original message.

DeleteOriginal

Delete the original message.