Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Web/Slack/Types/Item.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Web.Slack.Types.Base
import Control.Lens.TH
import Prelude

data Item = MessageItem ChannelId MessageUpdate
data Item = MessageItem ChannelId (Maybe MessageUpdate)
| FileItem File
| FileCommentItem File Comment
| ChannelItem ChannelId
Expand All @@ -24,7 +24,7 @@ instance FromJSON Item where
parseJSON = withObject "item" (\o -> do
(typ :: String) <- o .: "type"
case typ of
"message" -> MessageItem <$> o .: "channel" <*> o .: "message"
"message" -> MessageItem <$> o .: "channel" <*> o .:? "message"
"file" -> FileItem <$> o .: "file"
"file_comment" -> FileCommentItem <$> o .: "file" <*> o .: "comment"
"channel" -> ChannelItem <$> o .: "channel"
Expand Down