Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Types for the Slack Events API.
Synopsis
- data ChannelType
- data MessageEvent = MessageEvent {}
- 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 parseJSON :: Value -> Parser ChannelType # parseJSONList :: Value -> Parser [ChannelType] # | |
ToJSON ChannelType Source # | |
Defined in Web.Slack.Experimental.Events.Types toJSON :: ChannelType -> Value # toEncoding :: ChannelType -> Encoding # toJSONList :: [ChannelType] -> Value # toEncodingList :: [ChannelType] -> Encoding # | |
Show ChannelType Source # | |
Defined in Web.Slack.Experimental.Events.Types showsPrec :: Int -> ChannelType -> ShowS # show :: ChannelType -> String # showList :: [ChannelType] -> ShowS # | |
Eq ChannelType Source # | |
Defined in Web.Slack.Experimental.Events.Types (==) :: ChannelType -> ChannelType -> Bool # (/=) :: ChannelType -> ChannelType -> Bool # |
data MessageEvent Source #
MessageEvent | |
|
Instances
FromJSON MessageEvent Source # | |
Defined in Web.Slack.Experimental.Events.Types parseJSON :: Value -> Parser MessageEvent # parseJSONList :: Value -> Parser [MessageEvent] # | |
Show MessageEvent Source # | |
Defined in Web.Slack.Experimental.Events.Types showsPrec :: Int -> MessageEvent -> ShowS # show :: MessageEvent -> String # showList :: [MessageEvent] -> 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.
Instances
FromJSON MessageUpdateEvent Source # | |
Defined in Web.Slack.Experimental.Events.Types parseJSON :: Value -> Parser MessageUpdateEvent # parseJSONList :: Value -> Parser [MessageUpdateEvent] # | |
Show MessageUpdateEvent Source # | |
Defined in Web.Slack.Experimental.Events.Types 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.
CreatedChannel | |
|
Instances
FromJSON CreatedChannel Source # | |
Defined in Web.Slack.Experimental.Events.Types parseJSON :: Value -> Parser CreatedChannel # parseJSONList :: Value -> Parser [CreatedChannel] # | |
Show CreatedChannel Source # | |
Defined in Web.Slack.Experimental.Events.Types showsPrec :: Int -> CreatedChannel -> ShowS # show :: CreatedChannel -> String # showList :: [CreatedChannel] -> ShowS # |
data ChannelCreatedEvent Source #
A channel was created.
Instances
FromJSON ChannelCreatedEvent Source # | |
Defined in Web.Slack.Experimental.Events.Types parseJSON :: Value -> Parser ChannelCreatedEvent # parseJSONList :: Value -> Parser [ChannelCreatedEvent] # | |
Show ChannelCreatedEvent Source # | |
Defined in Web.Slack.Experimental.Events.Types showsPrec :: Int -> ChannelCreatedEvent -> ShowS # show :: ChannelCreatedEvent -> String # showList :: [ChannelCreatedEvent] -> ShowS # |
data ChannelLeftEvent Source #
You left a channel.
Instances
FromJSON ChannelLeftEvent Source # | |
Defined in Web.Slack.Experimental.Events.Types parseJSON :: Value -> Parser ChannelLeftEvent # parseJSONList :: Value -> Parser [ChannelLeftEvent] # | |
Show ChannelLeftEvent Source # | |
Defined in Web.Slack.Experimental.Events.Types showsPrec :: Int -> ChannelLeftEvent -> ShowS # show :: ChannelLeftEvent -> String # showList :: [ChannelLeftEvent] -> ShowS # |
data UrlVerificationPayload Source #
Instances
FromJSON UrlVerificationPayload Source # | |
Defined in Web.Slack.Experimental.Events.Types | |
Show UrlVerificationPayload Source # | |
Defined in Web.Slack.Experimental.Events.Types showsPrec :: Int -> UrlVerificationPayload -> ShowS # show :: UrlVerificationPayload -> String # showList :: [UrlVerificationPayload] -> ShowS # |
EventMessage MessageEvent | |
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 #
Instances
FromJSON EventCallback Source # | |
Defined in Web.Slack.Experimental.Events.Types parseJSON :: Value -> Parser EventCallback # parseJSONList :: Value -> Parser [EventCallback] # | |
Show EventCallback Source # | |
Defined in Web.Slack.Experimental.Events.Types showsPrec :: Int -> EventCallback -> ShowS # show :: EventCallback -> String # showList :: [EventCallback] -> ShowS # |
data SlackWebhookEvent Source #
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
.
Instances
ToJSON UrlVerificationResponse Source # | |
Defined in Web.Slack.Experimental.Events.Types | |
Show UrlVerificationResponse Source # | |
Defined in Web.Slack.Experimental.Events.Types showsPrec :: Int -> UrlVerificationResponse -> ShowS # show :: UrlVerificationResponse -> String # showList :: [UrlVerificationResponse] -> ShowS # |