Safe Haskell | Safe-Inferred |
---|---|
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 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
- 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
- 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 # | |
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 Methods parseJSON :: Value -> Parser AttachmentMessageBlockMessage # parseJSONList :: Value -> Parser [AttachmentMessageBlockMessage] # | |
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 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.
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
|
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 | |
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
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 # |