| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Web.Slack.Experimental.Events.Types
Contents
Description
Types for the Slack Events API.
Synopsis
- data ChannelType
- data AttachmentField = AttachmentField {}
- data AttachmentMessageBlockMessage = AttachmentMessageBlockMessage {
- blocks :: [SlackBlock]
- data AttachmentMessageBlock = AttachmentMessageBlock {}
- data DecodedMessageAttachment = DecodedMessageAttachment {
- fallback :: Maybe Text
- color :: Maybe Text
- pretext :: Maybe Text
- authorName :: Maybe Text
- authorLink :: Maybe Text
- authorIcon :: Maybe Text
- title :: Maybe Text
- titleLink :: Maybe Text
- text :: Maybe Text
- fields :: Maybe [AttachmentField]
- imageUrl :: Maybe Text
- thumbUrl :: Maybe Text
- footer :: Maybe Text
- footerIcon :: Maybe Text
- ts :: Maybe Text
- isMsgUnfurl :: Maybe Bool
- messageBlocks :: Maybe [AttachmentMessageBlock]
- authorId :: Maybe UserId
- channelId :: Maybe ConversationId
- channelTeam :: Maybe TeamId
- isAppUnfurl :: Maybe Bool
- appUnfurlUrl :: Maybe Text
- fromUrl :: Maybe Text
- data MessageAttachment = MessageAttachment {}
- data BotProfile = BotProfile {}
- data MessageEvent = MessageEvent {
- blocks :: Maybe [SlackBlock]
- channel :: ConversationId
- text :: Text
- channelType :: ChannelType
- files :: Maybe [FileObject]
- user :: UserId
- ts :: Text
- threadTs :: Maybe Text
- appId :: Maybe Text
- botId :: Maybe Text
- botProfile :: Maybe BotProfile
- attachments :: Maybe [MessageAttachment]
- data BotMessageEvent = BotMessageEvent {
- blocks :: Maybe [SlackBlock]
- channel :: ConversationId
- text :: Text
- channelType :: ChannelType
- files :: Maybe [FileObject]
- ts :: Text
- threadTs :: Maybe Text
- appId :: Maybe Text
- botId :: Text
- attachments :: Maybe [MessageAttachment]
- data MessageUpdateEvent = MessageUpdateEvent {}
- data CreatedChannel = CreatedChannel {
- id :: ConversationId
- isChannel :: Bool
- name :: Text
- nameNormalized :: Text
- creator :: UserId
- created :: SystemTime
- isShared :: Bool
- isOrgShared :: Bool
- contextTeamId :: TeamId
- data ChannelCreatedEvent = ChannelCreatedEvent {}
- data ChannelLeftEvent = ChannelLeftEvent {}
- data UrlVerificationPayload = UrlVerificationPayload {}
- newtype EventId = EventId {}
- newtype MessageId = MessageId {
- unMessageId :: Text
- newtype AppHomeTab = AppHomeTab {
- unAppHomeTab :: Text
- appHomeTabHome :: AppHomeTab
- appHomeTabMessages :: AppHomeTab
- data AppHomeOpenedEvent = AppHomeOpenedEvent {
- user :: UserId
- channel :: ConversationId
- tab :: AppHomeTab
- eventTs :: Text
- data Event
- data EventCallback = EventCallback {}
- data SlackWebhookEvent
- data UrlVerificationResponse = UrlVerificationResponse {}
Documentation
data ChannelType Source #
Not a ConversationType for some mysterious reason; this one has Channel as an option, which does not exist as a ConversationType. Slack, why?
Instances
| FromJSON ChannelType Source # | |
Defined in Web.Slack.Experimental.Events.Types | |
| ToJSON ChannelType Source # | |
Defined in Web.Slack.Experimental.Events.Types Methods toJSON :: ChannelType -> Value # toEncoding :: ChannelType -> Encoding # toJSONList :: [ChannelType] -> Value # toEncodingList :: [ChannelType] -> Encoding # omitField :: ChannelType -> Bool # | |
| Show ChannelType Source # | |
Defined in Web.Slack.Experimental.Events.Types Methods showsPrec :: Int -> ChannelType -> ShowS # show :: ChannelType -> String # showList :: [ChannelType] -> ShowS # | |
| Eq ChannelType Source # | |
Defined in Web.Slack.Experimental.Events.Types | |
data AttachmentField Source #
https://api.slack.com/events/message/message_attachment Ported from https://github.com/slackapi/node-slack-sdk/blob/fc87d51/packages/types/src/message-attachments.ts
Since: 2.0.0.3
Instances
| FromJSON AttachmentField Source # | |
Defined in Web.Slack.Experimental.Events.Types Methods parseJSON :: Value -> Parser AttachmentField # parseJSONList :: Value -> Parser [AttachmentField] # | |
| Show AttachmentField Source # | |
Defined in Web.Slack.Experimental.Events.Types Methods showsPrec :: Int -> AttachmentField -> ShowS # show :: AttachmentField -> String # showList :: [AttachmentField] -> ShowS # | |
data AttachmentMessageBlockMessage Source #
Since: 2.0.0.3
Constructors
| AttachmentMessageBlockMessage | |
Fields
| |
Instances
| FromJSON AttachmentMessageBlockMessage Source # | |
Defined in Web.Slack.Experimental.Events.Types | |
| Show AttachmentMessageBlockMessage Source # | |
Defined in Web.Slack.Experimental.Events.Types Methods showsPrec :: Int -> AttachmentMessageBlockMessage -> ShowS # show :: AttachmentMessageBlockMessage -> String # showList :: [AttachmentMessageBlockMessage] -> ShowS # | |
data AttachmentMessageBlock Source #
Since: 2.0.0.3
Constructors
| AttachmentMessageBlock | |
Fields
| |
Instances
| FromJSON AttachmentMessageBlock Source # | |
Defined in Web.Slack.Experimental.Events.Types Methods parseJSON :: Value -> Parser AttachmentMessageBlock # parseJSONList :: Value -> Parser [AttachmentMessageBlock] # | |
| Show AttachmentMessageBlock Source # | |
Defined in Web.Slack.Experimental.Events.Types Methods showsPrec :: Int -> AttachmentMessageBlock -> ShowS # show :: AttachmentMessageBlock -> String # showList :: [AttachmentMessageBlock] -> ShowS # | |
data DecodedMessageAttachment Source #
https://api.slack.com/events/message/message_attachment Ported from https://github.com/slackapi/node-slack-sdk/blob/fc87d51/packages/types/src/message-attachments.ts
Since: 2.0.0.3
Constructors
| DecodedMessageAttachment | |
Fields
| |
Instances
| FromJSON DecodedMessageAttachment Source # | |
Defined in Web.Slack.Experimental.Events.Types Methods parseJSON :: Value -> Parser DecodedMessageAttachment # parseJSONList :: Value -> Parser [DecodedMessageAttachment] # | |
| Show DecodedMessageAttachment Source # | |
Defined in Web.Slack.Experimental.Events.Types Methods showsPrec :: Int -> DecodedMessageAttachment -> ShowS # show :: DecodedMessageAttachment -> String # showList :: [DecodedMessageAttachment] -> ShowS # | |
data MessageAttachment Source #
Constructors
| MessageAttachment | |
Fields
| |
Instances
| FromJSON MessageAttachment Source # | |
Defined in Web.Slack.Experimental.Events.Types Methods parseJSON :: Value -> Parser MessageAttachment # parseJSONList :: Value -> Parser [MessageAttachment] # | |
| Show MessageAttachment Source # | |
Defined in Web.Slack.Experimental.Events.Types Methods showsPrec :: Int -> MessageAttachment -> ShowS # show :: MessageAttachment -> String # showList :: [MessageAttachment] -> ShowS # | |
data BotProfile Source #
bot_profile field of message events.
Since: 2.1.0.0
Instances
| FromJSON BotProfile Source # | |
Defined in Web.Slack.Experimental.Events.Types | |
| Show BotProfile Source # | |
Defined in Web.Slack.Experimental.Events.Types Methods showsPrec :: Int -> BotProfile -> ShowS # show :: BotProfile -> String # showList :: [BotProfile] -> ShowS # | |
data MessageEvent Source #
Constructors
| MessageEvent | |
Fields
| |
Instances
| FromJSON MessageEvent Source # | |
Defined in Web.Slack.Experimental.Events.Types | |
| Show MessageEvent Source # | |
Defined in Web.Slack.Experimental.Events.Types Methods showsPrec :: Int -> MessageEvent -> ShowS # show :: MessageEvent -> String # showList :: [MessageEvent] -> ShowS # | |
data BotMessageEvent Source #
https://api.slack.com/events/message/bot_message This is similar to a MessageEvent but sent by a bot, for example messages that Reacji Channeler sends.
This only applies to *legacy* bots. Modern Slack apps do not send
bot_message events; see the Slack documentation.
FIXME(jadel): remove this completely after March 31 2025 (?) or March 2026 (?) since the things that send these will likely vanish. https://api.slack.com/changelog/2024-09-legacy-custom-bots-classic-apps-deprecation
Since: 2.0.0.2
Constructors
| BotMessageEvent | |
Fields
| |
Instances
| FromJSON BotMessageEvent Source # | |
Defined in Web.Slack.Experimental.Events.Types Methods parseJSON :: Value -> Parser BotMessageEvent # parseJSONList :: Value -> Parser [BotMessageEvent] # | |
| Show BotMessageEvent Source # | |
Defined in Web.Slack.Experimental.Events.Types Methods showsPrec :: Int -> BotMessageEvent -> ShowS # show :: BotMessageEvent -> String # showList :: [BotMessageEvent] -> ShowS # | |
data MessageUpdateEvent Source #
https://api.slack.com/events/message/message_changed
FIXME(jadel): implement. This is mega cursed! in the normal message event the channel is called "channel" but here it is called "channelId" and also has a "channel_name" and "channel_team". Why?!
We don't decode these on this basis.
Constructors
| MessageUpdateEvent | |
Fields | |
Instances
| FromJSON MessageUpdateEvent Source # | |
Defined in Web.Slack.Experimental.Events.Types Methods parseJSON :: Value -> Parser MessageUpdateEvent # parseJSONList :: Value -> Parser [MessageUpdateEvent] # | |
| Show MessageUpdateEvent Source # | |
Defined in Web.Slack.Experimental.Events.Types Methods showsPrec :: Int -> MessageUpdateEvent -> ShowS # show :: MessageUpdateEvent -> String # showList :: [MessageUpdateEvent] -> ShowS # | |
data CreatedChannel Source #
FIXME: this might be a Channel, but may also be missing some fields/have bonus because Slack is cursed.
Constructors
| CreatedChannel | |
Fields
| |
Instances
| FromJSON CreatedChannel Source # | |
Defined in Web.Slack.Experimental.Events.Types Methods parseJSON :: Value -> Parser CreatedChannel # parseJSONList :: Value -> Parser [CreatedChannel] # | |
| Show CreatedChannel Source # | |
Defined in Web.Slack.Experimental.Events.Types Methods showsPrec :: Int -> CreatedChannel -> ShowS # show :: CreatedChannel -> String # showList :: [CreatedChannel] -> ShowS # | |
data ChannelCreatedEvent Source #
A channel was created.
Constructors
| ChannelCreatedEvent | |
Fields | |
Instances
| FromJSON ChannelCreatedEvent Source # | |
Defined in Web.Slack.Experimental.Events.Types Methods parseJSON :: Value -> Parser ChannelCreatedEvent # parseJSONList :: Value -> Parser [ChannelCreatedEvent] # | |
| Show ChannelCreatedEvent Source # | |
Defined in Web.Slack.Experimental.Events.Types Methods showsPrec :: Int -> ChannelCreatedEvent -> ShowS # show :: ChannelCreatedEvent -> String # showList :: [ChannelCreatedEvent] -> ShowS # | |
data ChannelLeftEvent Source #
You left a channel.
Constructors
| ChannelLeftEvent | |
Instances
| FromJSON ChannelLeftEvent Source # | |
Defined in Web.Slack.Experimental.Events.Types Methods parseJSON :: Value -> Parser ChannelLeftEvent # parseJSONList :: Value -> Parser [ChannelLeftEvent] # | |
| Show ChannelLeftEvent Source # | |
Defined in Web.Slack.Experimental.Events.Types Methods showsPrec :: Int -> ChannelLeftEvent -> ShowS # show :: ChannelLeftEvent -> String # showList :: [ChannelLeftEvent] -> ShowS # | |
data UrlVerificationPayload Source #
Constructors
| UrlVerificationPayload | |
Instances
| FromJSON UrlVerificationPayload Source # | |
Defined in Web.Slack.Experimental.Events.Types Methods parseJSON :: Value -> Parser UrlVerificationPayload # parseJSONList :: Value -> Parser [UrlVerificationPayload] # | |
| Show UrlVerificationPayload Source # | |
Defined in Web.Slack.Experimental.Events.Types Methods showsPrec :: Int -> UrlVerificationPayload -> ShowS # show :: UrlVerificationPayload -> String # showList :: [UrlVerificationPayload] -> ShowS # | |
Constructors
| MessageId | |
Fields
| |
newtype AppHomeTab Source #
Which tab of App Home is open.
Since: 2.1.0.0
Constructors
| AppHomeTab | |
Fields
| |
Instances
| FromJSON AppHomeTab Source # | |
Defined in Web.Slack.Experimental.Events.Types | |
| ToJSON AppHomeTab Source # | |
Defined in Web.Slack.Experimental.Events.Types Methods toJSON :: AppHomeTab -> Value # toEncoding :: AppHomeTab -> Encoding # toJSONList :: [AppHomeTab] -> Value # toEncodingList :: [AppHomeTab] -> Encoding # omitField :: AppHomeTab -> Bool # | |
| Show AppHomeTab Source # | |
Defined in Web.Slack.Experimental.Events.Types Methods showsPrec :: Int -> AppHomeTab -> ShowS # show :: AppHomeTab -> String # showList :: [AppHomeTab] -> ShowS # | |
| Eq AppHomeTab Source # | |
Defined in Web.Slack.Experimental.Events.Types | |
appHomeTabHome :: AppHomeTab Source #
Home tab of App Home.
Since: 2.1.0.0
appHomeTabMessages :: AppHomeTab Source #
Messages tab of App Home.
Since: 2.1.0.0
data AppHomeOpenedEvent Source #
App Home Opened event: when a Slack bot's home page is opened.
https://api.slack.com/events/app_home_opened
See also: https://api.slack.com/reference/app-home
Since: 2.1.0.0
Constructors
| AppHomeOpenedEvent | |
Fields
| |
Instances
| FromJSON AppHomeOpenedEvent Source # | |
Defined in Web.Slack.Experimental.Events.Types Methods parseJSON :: Value -> Parser AppHomeOpenedEvent # parseJSONList :: Value -> Parser [AppHomeOpenedEvent] # | |
| Show AppHomeOpenedEvent Source # | |
Defined in Web.Slack.Experimental.Events.Types Methods showsPrec :: Int -> AppHomeOpenedEvent -> ShowS # show :: AppHomeOpenedEvent -> String # showList :: [AppHomeOpenedEvent] -> ShowS # | |
Constructors
| EventMessage MessageEvent | |
| EventBotMessage BotMessageEvent | |
| EventMessageChanged | |
| EventChannelJoinMessage | Weird message event of subtype channel_join. Sent "sometimes", according to a random Slack blog post from 2017: https://api.slack.com/changelog/2017-05-rethinking-channel-entrance-and-exit-events-and-messages Documentation: https://api.slack.com/events/message/channel_join |
| EventChannelCreated ChannelCreatedEvent | |
| EventChannelLeft ChannelLeftEvent | |
| EventAppHomeOpened AppHomeOpenedEvent | Since: 2.1.0.0 |
| EventUnknown Value |
Instances
data EventCallback Source #
Constructors
| EventCallback | |
Instances
| FromJSON EventCallback Source # | |
Defined in Web.Slack.Experimental.Events.Types Methods parseJSON :: Value -> Parser EventCallback # parseJSONList :: Value -> Parser [EventCallback] # | |
| Show EventCallback Source # | |
Defined in Web.Slack.Experimental.Events.Types Methods showsPrec :: Int -> EventCallback -> ShowS # show :: EventCallback -> String # showList :: [EventCallback] -> ShowS # | |
data SlackWebhookEvent Source #
Constructors
| EventUrlVerification UrlVerificationPayload | |
| EventEventCallback EventCallback | |
| EventUnknownWebhook Value |
Instances
| FromJSON SlackWebhookEvent Source # | |||||
Defined in Web.Slack.Experimental.Events.Types Methods parseJSON :: Value -> Parser SlackWebhookEvent # parseJSONList :: Value -> Parser [SlackWebhookEvent] # | |||||
| Generic SlackWebhookEvent Source # | |||||
Defined in Web.Slack.Experimental.Events.Types Associated Types
Methods from :: SlackWebhookEvent -> Rep SlackWebhookEvent x # to :: Rep SlackWebhookEvent x -> SlackWebhookEvent # | |||||
| Show SlackWebhookEvent Source # | |||||
Defined in Web.Slack.Experimental.Events.Types Methods showsPrec :: Int -> SlackWebhookEvent -> ShowS # show :: SlackWebhookEvent -> String # showList :: [SlackWebhookEvent] -> ShowS # | |||||
| type Rep SlackWebhookEvent Source # | |||||
Defined in Web.Slack.Experimental.Events.Types type Rep SlackWebhookEvent = D1 ('MetaData "SlackWebhookEvent" "Web.Slack.Experimental.Events.Types" "slack-web-2.2.0.0-2X4wKOtrXI0LMO4H3hWcQt" 'False) (C1 ('MetaCons "EventUrlVerification" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UrlVerificationPayload)) :+: (C1 ('MetaCons "EventEventCallback" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 EventCallback)) :+: C1 ('MetaCons "EventUnknownWebhook" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Value)))) | |||||
Event responses
By and large, Slack does not care about the response returned from event
handlers, at least for the EventEventCallback as long as your service
200s. The exception is EventUrlVerification, which is expected to return a
UrlVerificationResponse
data UrlVerificationResponse Source #
Response for url_verification.
Constructors
| UrlVerificationResponse | |
Instances
| ToJSON UrlVerificationResponse Source # | |
Defined in Web.Slack.Experimental.Events.Types Methods toJSON :: UrlVerificationResponse -> Value # toEncoding :: UrlVerificationResponse -> Encoding # toJSONList :: [UrlVerificationResponse] -> Value # | |
| Show UrlVerificationResponse Source # | |
Defined in Web.Slack.Experimental.Events.Types Methods showsPrec :: Int -> UrlVerificationResponse -> ShowS # show :: UrlVerificationResponse -> String # showList :: [UrlVerificationResponse] -> ShowS # | |