Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- class Slack a where
- newtype SlackText = SlackText {
- unSlackTexts :: [Text]
- link :: Text -> Maybe Text -> SlackText
- data SlackPlainTextOnly = SlackPlainTextOnly SlackText
- plaintextonly :: Slack a => a -> SlackPlainTextOnly
- data SlackTextObject
- plaintext :: Slack a => a -> SlackTextObject
- mrkdwn :: Slack a => a -> SlackTextObject
- newtype OptionalSetting a = OptionalSetting {
- unOptionalSetting :: Maybe a
- setting :: a -> OptionalSetting a
- emptySetting :: OptionalSetting a
- data SlackStyle
- newtype SlackActionId = SlackActionId {
- unSlackActionId :: NonEmptyText 255
- data SlackImage = SlackImage {
- slackImageTitle :: !(Maybe Text)
- slackImageAltText :: !Text
- slackImageUrl :: !Text
- data SlackContent
- newtype SlackContext = SlackContext [SlackContent]
- type SlackActionListConstraints = SizeGreaterThan 0 && SizeLessThan 6
- newtype SlackActionList = SlackActionList {}
- class ToSlackActionList a where
- toSlackActionList :: a -> SlackActionList
- data RichStyle = RichStyle {}
- data RichLinkAttrs = RichLinkAttrs {}
- data RichItem
- data RichTextSectionItem
- data RichText = RichText {}
- data SlackAccessory = SlackButtonAccessory SlackAction
- sectionWithButtonAccessory :: SlackAction -> SlackText -> SlackBlock
- data SlackBlock
- newtype SlackMessage = SlackMessage [SlackBlock]
- textToMessage :: Text -> SlackMessage
- class Markdown a where
- class Image a where
- image :: SlackImage -> a
- context :: SlackContext -> SlackMessage
- textToContext :: Text -> SlackMessage
- actions :: ToSlackActionList as => as -> SlackMessage
- actionsWithBlockId :: ToSlackActionList as => SlackBlockId -> as -> SlackMessage
- data ButtonSettings = ButtonSettings {}
- buttonSettings :: ButtonSettings
- button :: SlackActionId -> SlackButtonText -> ButtonSettings -> SlackAction
- data ConfirmSettings = ConfirmSettings {}
- confirmAreYouSure :: ConfirmSettings
- confirm :: ConfirmSettings -> SlackConfirmObject
- type SlackBlockId = NonEmptyText 255
- data SlackAction = SlackAction SlackActionId SlackActionComponent
- data SlackConfirmObject = SlackConfirmObject {}
- newtype SlackResponseUrl = SlackResponseUrl {}
- data SlackInteractivePayload = SlackInteractivePayload {}
- data SlackActionResponse = SlackActionResponse {}
- data SlackInteractiveResponseResponse = SlackInteractiveResponseResponse {}
- data SlackInteractiveResponse
- newtype SlackButtonText = SlackButtonText (NonEmptyText 75)
- data SlackActionComponent = SlackButton {}
Documentation
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.
SlackText | |
|
data SlackPlainTextOnly Source #
Instances
FromJSON SlackPlainTextOnly Source # | |
Defined in Web.Slack.Experimental.Blocks.Types parseJSON :: Value -> Parser SlackPlainTextOnly # parseJSONList :: Value -> Parser [SlackPlainTextOnly] # | |
ToJSON SlackPlainTextOnly Source # | |
Defined in Web.Slack.Experimental.Blocks.Types toJSON :: SlackPlainTextOnly -> Value # toEncoding :: SlackPlainTextOnly -> Encoding # toJSONList :: [SlackPlainTextOnly] -> Value # toEncodingList :: [SlackPlainTextOnly] -> Encoding # | |
IsString SlackPlainTextOnly Source # | |
Defined in Web.Slack.Experimental.Blocks.Types fromString :: String -> SlackPlainTextOnly # | |
Show SlackPlainTextOnly Source # | |
Defined in Web.Slack.Experimental.Blocks.Types showsPrec :: Int -> SlackPlainTextOnly -> ShowS # show :: SlackPlainTextOnly -> String # showList :: [SlackPlainTextOnly] -> ShowS # | |
Eq SlackPlainTextOnly Source # | |
Defined in Web.Slack.Experimental.Blocks.Types (==) :: SlackPlainTextOnly -> SlackPlainTextOnly -> Bool # (/=) :: SlackPlainTextOnly -> SlackPlainTextOnly -> Bool # |
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.
data SlackTextObject Source #
Instances
FromJSON SlackTextObject Source # | |
Defined in Web.Slack.Experimental.Blocks.Types parseJSON :: Value -> Parser SlackTextObject # parseJSONList :: Value -> Parser [SlackTextObject] # | |
ToJSON SlackTextObject Source # | |
Defined in Web.Slack.Experimental.Blocks.Types toJSON :: SlackTextObject -> Value # toEncoding :: SlackTextObject -> Encoding # toJSONList :: [SlackTextObject] -> Value # toEncodingList :: [SlackTextObject] -> Encoding # | |
Show SlackTextObject Source # | |
Defined in Web.Slack.Experimental.Blocks.Types showsPrec :: Int -> SlackTextObject -> ShowS # show :: SlackTextObject -> String # showList :: [SlackTextObject] -> ShowS # | |
Eq SlackTextObject Source # | |
Defined in Web.Slack.Experimental.Blocks.Types (==) :: SlackTextObject -> SlackTextObject -> Bool # (/=) :: SlackTextObject -> SlackTextObject -> Bool # |
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.
Instances
IsString (OptionalSetting Text) Source # | Allows using bare Texts without having to use |
Defined in Web.Slack.Experimental.Blocks.Types fromString :: String -> OptionalSetting Text # | |
IsString (OptionalSetting String) Source # | Allows using bare Strings without having to use |
Defined in Web.Slack.Experimental.Blocks.Types fromString :: String -> OptionalSetting String # | |
Eq a => Eq (OptionalSetting a) Source # | |
Defined in Web.Slack.Experimental.Blocks.Types (==) :: OptionalSetting a -> OptionalSetting a -> Bool # (/=) :: OptionalSetting a -> OptionalSetting a -> Bool # |
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.
SlackStylePrimary | Green button |
SlackStyleDanger | Red button |
Instances
FromJSON SlackStyle Source # | |
Defined in Web.Slack.Experimental.Blocks.Types parseJSON :: Value -> Parser SlackStyle # parseJSONList :: Value -> Parser [SlackStyle] # | |
ToJSON SlackStyle Source # | |
Defined in Web.Slack.Experimental.Blocks.Types toJSON :: SlackStyle -> Value # toEncoding :: SlackStyle -> Encoding # toJSONList :: [SlackStyle] -> Value # toEncodingList :: [SlackStyle] -> Encoding # | |
Show SlackStyle Source # | |
Defined in Web.Slack.Experimental.Blocks.Types showsPrec :: Int -> SlackStyle -> ShowS # show :: SlackStyle -> String # showList :: [SlackStyle] -> ShowS # | |
Eq SlackStyle Source # | |
Defined in Web.Slack.Experimental.Blocks.Types (==) :: SlackStyle -> SlackStyle -> Bool # (/=) :: SlackStyle -> SlackStyle -> Bool # |
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
Instances
FromJSON SlackActionId Source # | |
Defined in Web.Slack.Experimental.Blocks.Types parseJSON :: Value -> Parser SlackActionId # parseJSONList :: Value -> Parser [SlackActionId] # | |
ToJSON SlackActionId Source # | |
Defined in Web.Slack.Experimental.Blocks.Types toJSON :: SlackActionId -> Value # toEncoding :: SlackActionId -> Encoding # toJSONList :: [SlackActionId] -> Value # toEncodingList :: [SlackActionId] -> Encoding # | |
Show SlackActionId Source # | |
Defined in Web.Slack.Experimental.Blocks.Types showsPrec :: Int -> SlackActionId -> ShowS # show :: SlackActionId -> String # showList :: [SlackActionId] -> ShowS # | |
Eq SlackActionId Source # | |
Defined in Web.Slack.Experimental.Blocks.Types (==) :: SlackActionId -> SlackActionId -> Bool # (/=) :: SlackActionId -> SlackActionId -> Bool # |
data SlackImage Source #
SlackImage | |
|
Instances
Show SlackImage Source # | |
Defined in Web.Slack.Experimental.Blocks.Types showsPrec :: Int -> SlackImage -> ShowS # show :: SlackImage -> String # showList :: [SlackImage] -> ShowS # | |
Eq SlackImage Source # | |
Defined in Web.Slack.Experimental.Blocks.Types (==) :: SlackImage -> SlackImage -> Bool # (/=) :: SlackImage -> SlackImage -> Bool # |
data SlackContent Source #
Instances
FromJSON SlackContent Source # | |
Defined in Web.Slack.Experimental.Blocks.Types parseJSON :: Value -> Parser SlackContent # parseJSONList :: Value -> Parser [SlackContent] # | |
ToJSON SlackContent Source # | |
Defined in Web.Slack.Experimental.Blocks.Types toJSON :: SlackContent -> Value # toEncoding :: SlackContent -> Encoding # toJSONList :: [SlackContent] -> Value # toEncodingList :: [SlackContent] -> Encoding # | |
Show SlackContent Source # | |
Defined in Web.Slack.Experimental.Blocks.Types showsPrec :: Int -> SlackContent -> ShowS # show :: SlackContent -> String # showList :: [SlackContent] -> ShowS # | |
Eq SlackContent Source # | |
Defined in Web.Slack.Experimental.Blocks.Types (==) :: SlackContent -> SlackContent -> Bool # (/=) :: SlackContent -> SlackContent -> Bool # |
newtype SlackContext Source #
Instances
type SlackActionListConstraints = SizeGreaterThan 0 && SizeLessThan 6 Source #
newtype SlackActionList Source #
List that enforces that Slack actions must have between 1 and 5 actions.
Instances
FromJSON SlackActionList Source # | |
Defined in Web.Slack.Experimental.Blocks.Types parseJSON :: Value -> Parser SlackActionList # parseJSONList :: Value -> Parser [SlackActionList] # | |
ToJSON SlackActionList Source # | |
Defined in Web.Slack.Experimental.Blocks.Types toJSON :: SlackActionList -> Value # toEncoding :: SlackActionList -> Encoding # toJSONList :: [SlackActionList] -> Value # toEncodingList :: [SlackActionList] -> Encoding # | |
Show SlackActionList Source # | |
Defined in Web.Slack.Experimental.Blocks.Types showsPrec :: Int -> SlackActionList -> ShowS # show :: SlackActionList -> String # showList :: [SlackActionList] -> ShowS # | |
Eq SlackActionList Source # | |
Defined in Web.Slack.Experimental.Blocks.Types (==) :: SlackActionList -> SlackActionList -> Bool # (/=) :: SlackActionList -> SlackActionList -> Bool # | |
ToSlackActionList SlackActionList Source # | |
class ToSlackActionList a where Source #
Helper to allow using up to a 5-tuple for a SlackActionList
toSlackActionList :: a -> SlackActionList Source #
Instances
A rich text style. You can't actually send these, for some reason.
data RichLinkAttrs Source #
Instances
Show RichLinkAttrs Source # | |
Defined in Web.Slack.Experimental.Blocks.Types showsPrec :: Int -> RichLinkAttrs -> ShowS # show :: RichLinkAttrs -> String # showList :: [RichLinkAttrs] -> ShowS # | |
Eq RichLinkAttrs Source # | |
Defined in Web.Slack.Experimental.Blocks.Types (==) :: RichLinkAttrs -> RichLinkAttrs -> Bool # (/=) :: RichLinkAttrs -> RichLinkAttrs -> Bool # |
Seemingly only documented at https://api.slack.com/changelog/2019-09-what-they-see-is-what-you-get-and-more-and-less
They warn of undocumented element types. Joy.
RichItemText Text RichStyle | |
RichItemChannel ConversationId | |
RichItemUser UserId RichStyle | |
RichItemLink RichLinkAttrs | |
RichItemEmoji Text | |
RichItemOther Text Value |
data RichTextSectionItem Source #
Instances
FromJSON RichTextSectionItem Source # | |
Defined in Web.Slack.Experimental.Blocks.Types parseJSON :: Value -> Parser RichTextSectionItem # parseJSONList :: Value -> Parser [RichTextSectionItem] # | |
Show RichTextSectionItem Source # | |
Defined in Web.Slack.Experimental.Blocks.Types showsPrec :: Int -> RichTextSectionItem -> ShowS # show :: RichTextSectionItem -> String # showList :: [RichTextSectionItem] -> ShowS # | |
Eq RichTextSectionItem Source # | |
Defined in Web.Slack.Experimental.Blocks.Types (==) :: RichTextSectionItem -> RichTextSectionItem -> Bool # (/=) :: RichTextSectionItem -> RichTextSectionItem -> Bool # |
data SlackAccessory Source #
Accessory is a type of optional block element that floats to the right of text in a BlockSection. https://api.slack.com/reference/block-kit/blocks#section_fields
Instances
FromJSON SlackAccessory Source # | |
Defined in Web.Slack.Experimental.Blocks.Types parseJSON :: Value -> Parser SlackAccessory # parseJSONList :: Value -> Parser [SlackAccessory] # | |
ToJSON SlackAccessory Source # | |
Defined in Web.Slack.Experimental.Blocks.Types toJSON :: SlackAccessory -> Value # toEncoding :: SlackAccessory -> Encoding # toJSONList :: [SlackAccessory] -> Value # toEncodingList :: [SlackAccessory] -> Encoding # | |
Show SlackAccessory Source # | |
Defined in Web.Slack.Experimental.Blocks.Types showsPrec :: Int -> SlackAccessory -> ShowS # show :: SlackAccessory -> String # showList :: [SlackAccessory] -> ShowS # | |
Eq SlackAccessory Source # | |
Defined in Web.Slack.Experimental.Blocks.Types (==) :: SlackAccessory -> SlackAccessory -> Bool # (/=) :: SlackAccessory -> SlackAccessory -> Bool # |
sectionWithButtonAccessory :: SlackAction -> SlackText -> SlackBlock Source #
Small helper function for constructing a section with a button accessory out of a button and text components
data SlackBlock Source #
Instances
FromJSON SlackBlock Source # | |
Defined in Web.Slack.Experimental.Blocks.Types parseJSON :: Value -> Parser SlackBlock # parseJSONList :: Value -> Parser [SlackBlock] # | |
ToJSON SlackBlock Source # | |
Defined in Web.Slack.Experimental.Blocks.Types toJSON :: SlackBlock -> Value # toEncoding :: SlackBlock -> Encoding # toJSONList :: [SlackBlock] -> Value # toEncodingList :: [SlackBlock] -> Encoding # | |
Show SlackBlock Source # | |
Defined in Web.Slack.Experimental.Blocks.Types showsPrec :: Int -> SlackBlock -> ShowS # show :: SlackBlock -> String # showList :: [SlackBlock] -> ShowS # | |
Eq SlackBlock Source # | |
Defined in Web.Slack.Experimental.Blocks.Types (==) :: SlackBlock -> SlackBlock -> Bool # (/=) :: SlackBlock -> SlackBlock -> Bool # |
newtype SlackMessage Source #
Instances
textToMessage :: Text -> SlackMessage Source #
class Markdown a where Source #
Instances
Markdown SlackContext Source # | |
Defined in Web.Slack.Experimental.Blocks.Types markdown :: SlackText -> SlackContext Source # | |
Markdown SlackMessage Source # | |
Defined in Web.Slack.Experimental.Blocks.Types markdown :: SlackText -> SlackMessage Source # |
image :: SlackImage -> a Source #
Instances
Image SlackContext Source # | |
Defined in Web.Slack.Experimental.Blocks.Types image :: SlackImage -> SlackContext Source # | |
Image SlackMessage Source # | |
Defined in Web.Slack.Experimental.Blocks.Types image :: SlackImage -> SlackMessage Source # |
context :: SlackContext -> SlackMessage Source #
textToContext :: Text -> SlackMessage Source #
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.
ButtonSettings | |
|
buttonSettings :: ButtonSettings Source #
Default button settings.
button :: SlackActionId -> SlackButtonText -> ButtonSettings -> SlackAction Source #
Button builder.
data ConfirmSettings Source #
Settings for confirmation dialog objects.
ConfirmSettings | |
|
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
data SlackConfirmObject Source #
Instances
FromJSON SlackConfirmObject Source # | |
Defined in Web.Slack.Experimental.Blocks.Types parseJSON :: Value -> Parser SlackConfirmObject # parseJSONList :: Value -> Parser [SlackConfirmObject] # | |
ToJSON SlackConfirmObject Source # | |
Defined in Web.Slack.Experimental.Blocks.Types toJSON :: SlackConfirmObject -> Value # toEncoding :: SlackConfirmObject -> Encoding # toJSONList :: [SlackConfirmObject] -> Value # toEncodingList :: [SlackConfirmObject] -> Encoding # | |
Eq SlackConfirmObject Source # | |
Defined in Web.Slack.Experimental.Blocks.Types (==) :: SlackConfirmObject -> SlackConfirmObject -> Bool # (/=) :: SlackConfirmObject -> SlackConfirmObject -> Bool # |
newtype SlackResponseUrl Source #
Instances
FromJSON SlackResponseUrl Source # | |
Defined in Web.Slack.Experimental.Blocks.Types parseJSON :: Value -> Parser SlackResponseUrl # parseJSONList :: Value -> Parser [SlackResponseUrl] # | |
ToJSON SlackResponseUrl Source # | |
Defined in Web.Slack.Experimental.Blocks.Types toJSON :: SlackResponseUrl -> Value # toEncoding :: SlackResponseUrl -> Encoding # toJSONList :: [SlackResponseUrl] -> Value # toEncodingList :: [SlackResponseUrl] -> Encoding # | |
Show SlackResponseUrl Source # | |
Defined in Web.Slack.Experimental.Blocks.Types showsPrec :: Int -> SlackResponseUrl -> ShowS # show :: SlackResponseUrl -> String # showList :: [SlackResponseUrl] -> ShowS # | |
Eq SlackResponseUrl Source # | |
Defined in Web.Slack.Experimental.Blocks.Types (==) :: SlackResponseUrl -> SlackResponseUrl -> Bool # (/=) :: SlackResponseUrl -> SlackResponseUrl -> Bool # |
data SlackInteractivePayload Source #
Represents the data we get from a callback from Slack for interactive operations. See https://api.slack.com/interactivity/handling#payloads
SlackInteractivePayload | |
|
Instances
FromJSON SlackInteractivePayload Source # | |
Defined in Web.Slack.Experimental.Blocks.Types | |
Show SlackInteractivePayload Source # | |
Defined in Web.Slack.Experimental.Blocks.Types showsPrec :: Int -> SlackInteractivePayload -> ShowS # show :: SlackInteractivePayload -> String # showList :: [SlackInteractivePayload] -> ShowS # |
data SlackActionResponse Source #
Which component and it's IDs that triggered an interactive webhook call.
Instances
FromJSON SlackActionResponse Source # | |
Defined in Web.Slack.Experimental.Blocks.Types parseJSON :: Value -> Parser SlackActionResponse # parseJSONList :: Value -> Parser [SlackActionResponse] # | |
Show SlackActionResponse Source # | |
Defined in Web.Slack.Experimental.Blocks.Types showsPrec :: Int -> SlackActionResponse -> ShowS # show :: SlackActionResponse -> String # showList :: [SlackActionResponse] -> ShowS # |
data SlackInteractiveResponseResponse Source #
Instances
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.
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. |
Instances
ToJSON SlackInteractiveResponse Source # | |
Defined in Web.Slack.Experimental.Blocks.Types | |
Show SlackInteractiveResponse Source # | |
Defined in Web.Slack.Experimental.Blocks.Types showsPrec :: Int -> SlackInteractiveResponse -> ShowS # show :: SlackInteractiveResponse -> String # showList :: [SlackInteractiveResponse] -> ShowS # |
newtype SlackButtonText Source #
Text to be displayed in a SlackButton
.
Up to 75 characters, but may be truncated to 30 characters.
Instances
FromJSON SlackButtonText Source # | |
Defined in Web.Slack.Experimental.Blocks.Types parseJSON :: Value -> Parser SlackButtonText # parseJSONList :: Value -> Parser [SlackButtonText] # | |
IsString SlackButtonText Source # | |
Defined in Web.Slack.Experimental.Blocks.Types fromString :: String -> SlackButtonText # | |
Show SlackButtonText Source # | |
Defined in Web.Slack.Experimental.Blocks.Types showsPrec :: Int -> SlackButtonText -> ShowS # show :: SlackButtonText -> String # showList :: [SlackButtonText] -> ShowS # | |
Eq SlackButtonText Source # | |
Defined in Web.Slack.Experimental.Blocks.Types (==) :: SlackButtonText -> SlackButtonText -> Bool # (/=) :: SlackButtonText -> SlackButtonText -> Bool # | |
Slack SlackButtonText Source # | |
Defined in Web.Slack.Experimental.Blocks.Types message :: SlackButtonText -> SlackText Source # |
data SlackActionComponent Source #
The component in a SlackAction
. Do not use directly.
Use the builder functions such as button
instead.
Instances
FromJSON SlackActionComponent Source # | |
Defined in Web.Slack.Experimental.Blocks.Types parseJSON :: Value -> Parser SlackActionComponent # parseJSONList :: Value -> Parser [SlackActionComponent] # | |
Show SlackActionComponent Source # | |
Defined in Web.Slack.Experimental.Blocks.Types showsPrec :: Int -> SlackActionComponent -> ShowS # show :: SlackActionComponent -> String # showList :: [SlackActionComponent] -> ShowS # | |
Eq SlackActionComponent Source # | |
Defined in Web.Slack.Experimental.Blocks.Types (==) :: SlackActionComponent -> SlackActionComponent -> Bool # (/=) :: SlackActionComponent -> SlackActionComponent -> Bool # |