Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Web.Slack.Experimental.Events.Types
Contents
Description
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 | |
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 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 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 | |
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 # |