-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Bindings to the Slack RTM API. -- -- This library provides bindings to the Slack Real Time Messaging -- API. Users should find it easy to program their own Slack bots -- using the functionality found in Web.Slack. The bindings are -- very nearly complete. Library authors looking to build bindings to the -- Slack Web API may find the FromJSON instances located in -- Web.Slack.Types useful. Please note that the interface provided -- by this package is not yet stable. There are a number of unresolved -- internal inconsistencies which have yet to be resolved by Slack HQ. @package slack-api @version 0.2 module Web.Slack.Types.Base type URL = Text module Web.Slack.Types.Presence data Presence Away :: Presence Active :: Presence instance Show Presence instance FromJSON Presence module Web.Slack.Types.Preferences data Preferences Preferences :: Text -> Text -> Bool -> Bool -> Maybe Text -> Bool -> Bool -> Bool -> Int -> Text -> Text -> Text -> Text -> Int -> Bool -> Bool -> Bool -> Bool -> Text -> Text -> Text -> Bool -> Text -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Text -> Bool -> Bool -> Bool -> Text -> Text -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Text -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Text -> Int -> Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Text -> Bool -> Bool -> Bool -> Bool -> Text -> Text -> Bool -> Bool -> Bool -> Text -> Int -> Text -> Bool -> Bool -> Bool -> Text -> Bool -> Bool -> Bool -> Bool -> Preferences _prefHighlightWords :: Preferences -> Text _prefUserColors :: Preferences -> Text _prefColorNamesInList :: Preferences -> Bool _prefGrowlsEnabled :: Preferences -> Bool _prefTimezone :: Preferences -> Maybe Text _prefPushDmAlert :: Preferences -> Bool _prefPushMentionAlert :: Preferences -> Bool _prefPushEverything :: Preferences -> Bool _prefPushIdleWait :: Preferences -> Int _prefPushSound :: Preferences -> Text _prefPushLoudChannels :: Preferences -> Text _prefPushLoudChannelsSet :: Preferences -> Text _prefEmailAlerts :: Preferences -> Text _prefEmailAlertsSleepUntil :: Preferences -> Int _prefEmailMisc :: Preferences -> Bool _prefEmailWeekly :: Preferences -> Bool _prefWelcomeMessageHidden :: Preferences -> Bool _prefAllChannelsLoud :: Preferences -> Bool _prefLoudChannels :: Preferences -> Text _prefNeverChannels :: Preferences -> Text _prefLoudChannelsSet :: Preferences -> Text _prefShowMemberPresence :: Preferences -> Bool _prefSearchSort :: Preferences -> Text _prefExpandInlineImgs :: Preferences -> Bool _prefExpandSnippets :: Preferences -> Bool _prefPostsFormattingGuide :: Preferences -> Bool _prefSeenWelcome2 :: Preferences -> Bool _prefSeenSsbPrompt :: Preferences -> Bool _prefSearchOnlyMyChannels :: Preferences -> Bool _prefEmojiMode :: Preferences -> Text _prefHasInvited :: Preferences -> Bool _prefHasUploaded :: Preferences -> Bool _prefHasCreatedChannel :: Preferences -> Bool _prefSearchExcludeChannels :: Preferences -> Text _prefMessagesTheme :: Preferences -> Text _prefWebappSpellcheck :: Preferences -> Bool _prefNoJoinedOverlays :: Preferences -> Bool _prefNoCreatedOverlays :: Preferences -> Bool _prefDropboxEnabled :: Preferences -> Bool _prefSeenUserMenuTipCard :: Preferences -> Bool _prefSeenTeamMenuTipCard :: Preferences -> Bool _prefSeenChannelMenuTipCard :: Preferences -> Bool _prefSeenMessageInputTipCard :: Preferences -> Bool _prefSeenChannelsTipCard :: Preferences -> Bool _prefSeenDomainInviteReminder :: Preferences -> Bool _prefSeenMemberInviteReminder :: Preferences -> Bool _prefSeenFlexpaneTipCard :: Preferences -> Bool _prefMuteSounds :: Preferences -> Bool _prefArrowHistory :: Preferences -> Bool _prefTabUiReturnSelects :: Preferences -> Bool _prefObeyInlineImgLimit :: Preferences -> Bool _prefNewMsgSnd :: Preferences -> Text _prefCollapsible :: Preferences -> Bool _prefCollapsibleByClick :: Preferences -> Bool _prefRequireAt :: Preferences -> Bool _prefMacSsbBullet :: Preferences -> Bool _prefWinSsbBullet :: Preferences -> Bool _prefExpandNonMediaAttachments :: Preferences -> Bool _prefShowTyping :: Preferences -> Bool _prefPagekeysHandled :: Preferences -> Bool _prefLastSnippetType :: Preferences -> Text _prefDisplayRealNamesOverride :: Preferences -> Int _prefTime24 :: Preferences -> Bool _prefEnterIsSpecialInTbt :: Preferences -> Bool _prefGraphicEmoticons :: Preferences -> Bool _prefConvertEmoticons :: Preferences -> Bool _prefAutoplayChatSounds :: Preferences -> Bool _prefSsEmojis :: Preferences -> Bool _prefSidebarBehavior :: Preferences -> Text _prefMarkMsgsReadImmediately :: Preferences -> Bool _prefStartScrollAtOldest :: Preferences -> Bool _prefSnippetEditorWrapLongLines :: Preferences -> Bool _prefLsDisabled :: Preferences -> Bool _prefSidebarTheme :: Preferences -> Text _prefSidebarThemeCustomValues :: Preferences -> Text _prefFKeySearch :: Preferences -> Bool _prefKKeyOmnibox :: Preferences -> Bool _prefSpeakGrowls :: Preferences -> Bool _prefMacSpeakVoice :: Preferences -> Text _prefMacSpeakSpeed :: Preferences -> Int _prefPushAtChannelSuppressedChannels :: Preferences -> Text _prefPromptedForEmailDisabling :: Preferences -> Bool _prefFullTextExtracts :: Preferences -> Bool _prefNoTextInNotifications :: Preferences -> Bool _prefMutedChannels :: Preferences -> Text _prefNoMacssb1Banner :: Preferences -> Bool _prefPrivacyPolicySeen :: Preferences -> Bool _prefSearchExcludeBots :: Preferences -> Bool _prefFuzzyMatching :: Preferences -> Bool instance FromJSON Preferences instance ToJSON Preferences instance Show Preferences module Web.Slack.Types.Error data SlackError SlackError :: SlackError instance FromJSON SlackError instance Show SlackError module Web.Slack.Types.Time newtype Time Time :: POSIXTime -> Time _getTime :: Time -> POSIXTime data SlackTimeStamp SlackTimeStamp :: Time -> Int -> SlackTimeStamp _slackTime :: SlackTimeStamp -> Time _timestampUid :: SlackTimeStamp -> Int timestampUid :: Lens' SlackTimeStamp Int slackTime :: Lens' SlackTimeStamp Time getTime :: Iso' Time POSIXTime instance FromJSON Time instance FromJSON SlackTimeStamp instance Fractional Time instance Num Time instance Real Time instance Eq Time instance Ord Time instance Show Time instance Show SlackTimeStamp instance Ord SlackTimeStamp instance Eq SlackTimeStamp module Web.Slack.Types.Id type UserId = Id TUser type BotId = Id TBot type ChannelId = Id TChannel type FileId = Id TFile type CommentId = Id TComment type GroupId = Id TGroup type IMId = Id TIM type TeamId = Id TTeam data Id (a :: FieldType) getId :: Iso (Id a_ayVY) (Id a_ayZp) Text Text instance Eq FieldType instance Show FieldType instance Show (Id a) instance Eq (Id a) instance FromJSON (Id a) instance ToJSON (Id a) module Web.Slack.Types.TeamPreferences data TeamPreferences TeamPreferences :: [ChannelId] -> Int -> Bool -> Bool -> Bool -> Text -> Text -> Text -> Text -> Text -> Text -> Text -> Text -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> TeamPreferences _teamDefaultChannels :: TeamPreferences -> [ChannelId] _teamMsgEditWindowMins :: TeamPreferences -> Int _teamAllowMessageDeletion :: TeamPreferences -> Bool _teamHideReferers :: TeamPreferences -> Bool _teamDisplayRealNames :: TeamPreferences -> Bool _teamWhoCanAtEveryone :: TeamPreferences -> Text _teamWhoCanAtChannel :: TeamPreferences -> Text _teamWhoCanCreateChannels :: TeamPreferences -> Text _teamWhoCanArchiveChannels :: TeamPreferences -> Text _teamWhoCanCreateGroups :: TeamPreferences -> Text _teamWhoCanPostGeneral :: TeamPreferences -> Text _teamWhoCanKickChannels :: TeamPreferences -> Text _teamWhoCanKickGroups :: TeamPreferences -> Text _teamRetentionType :: TeamPreferences -> Int _teamRetentionDuration :: TeamPreferences -> Int _teamGroupRetentionType :: TeamPreferences -> Int _teamGroupRetentionDuration :: TeamPreferences -> Int _teamDmRetentionType :: TeamPreferences -> Int _teamDmRetentionDuration :: TeamPreferences -> Int _teamRequireAtForMention :: TeamPreferences -> Int teamWhoCanPostGeneral :: Lens' TeamPreferences Text teamWhoCanKickGroups :: Lens' TeamPreferences Text teamWhoCanKickChannels :: Lens' TeamPreferences Text teamWhoCanCreateGroups :: Lens' TeamPreferences Text teamWhoCanCreateChannels :: Lens' TeamPreferences Text teamWhoCanAtEveryone :: Lens' TeamPreferences Text teamWhoCanAtChannel :: Lens' TeamPreferences Text teamWhoCanArchiveChannels :: Lens' TeamPreferences Text teamRetentionType :: Lens' TeamPreferences Int teamRetentionDuration :: Lens' TeamPreferences Int teamRequireAtForMention :: Lens' TeamPreferences Int teamMsgEditWindowMins :: Lens' TeamPreferences Int teamHideReferers :: Lens' TeamPreferences Bool teamGroupRetentionType :: Lens' TeamPreferences Int teamGroupRetentionDuration :: Lens' TeamPreferences Int teamDmRetentionType :: Lens' TeamPreferences Int teamDmRetentionDuration :: Lens' TeamPreferences Int teamDisplayRealNames :: Lens' TeamPreferences Bool teamDefaultChannels :: Lens' TeamPreferences [ChannelId] teamAllowMessageDeletion :: Lens' TeamPreferences Bool instance FromJSON TeamPreferences instance ToJSON TeamPreferences instance Show TeamPreferences module Web.Slack.Types.Team data Team Team :: TeamId -> Text -> Text -> Text -> TeamPreferences -> TeamIcons -> Bool -> Team _teamId :: Team -> TeamId _teamName :: Team -> Text _teamEmailDomain :: Team -> Text _teamDomain :: Team -> Text _teamPreferences :: Team -> TeamPreferences _teamIcons :: Team -> TeamIcons _teamOverStorageLimit :: Team -> Bool data TeamIcons TeamIcons :: URL -> URL -> URL -> URL -> URL -> URL -> Bool -> TeamIcons _teamIcon34 :: TeamIcons -> URL _teamIcon44 :: TeamIcons -> URL _teamIcon68 :: TeamIcons -> URL _teamIcon88 :: TeamIcons -> URL _teamIcon102 :: TeamIcons -> URL _teamIcon132 :: TeamIcons -> URL _teamIconDefault :: TeamIcons -> Bool teamPreferences :: Lens' Team TeamPreferences teamOverStorageLimit :: Lens' Team Bool teamName :: Lens' Team Text teamId :: Lens' Team TeamId teamIcons :: Lens' Team TeamIcons teamEmailDomain :: Lens' Team Text teamDomain :: Lens' Team Text teamIconDefault :: Lens' TeamIcons Bool teamIcon88 :: Lens' TeamIcons URL teamIcon68 :: Lens' TeamIcons URL teamIcon44 :: Lens' TeamIcons URL teamIcon34 :: Lens' TeamIcons URL teamIcon132 :: Lens' TeamIcons URL teamIcon102 :: Lens' TeamIcons URL instance FromJSON TeamIcons instance FromJSON Team instance Show TeamIcons instance Show Team module Web.Slack.Types.Self data Self Self :: UserId -> Text -> Preferences -> Time -> Presence -> Self _selfUserId :: Self -> UserId _selfName :: Self -> Text _selfPreferences :: Self -> Preferences _selfCreated :: Self -> Time _selfManualPresence :: Self -> Presence selfUserId :: Lens' Self UserId selfPreferences :: Lens' Self Preferences selfName :: Lens' Self Text selfManualPresence :: Lens' Self Presence selfCreated :: Lens' Self Time instance FromJSON Self instance Show Self module Web.Slack.Types.User data User User :: UserId -> Text -> Bool -> Maybe Text -> Text -> Profile -> Permissions -> Bool -> Timezone -> User _userId :: User -> UserId _userName :: User -> Text _userDeleted :: User -> Bool _userStatus :: User -> Maybe Text _userColor :: User -> Text _userProfile :: User -> Profile _userPermission :: User -> Permissions _userHasFiles :: User -> Bool _userTimezone :: User -> Timezone defaultTimezone :: Timezone data Timezone Timezone :: Maybe Text -> Text -> Int -> Timezone _timezoneDesc :: Timezone -> Maybe Text _timezoneLabel :: Timezone -> Text _timezoneOffset :: Timezone -> Int data Permissions Permissions :: Bool -> Bool -> Bool -> Bool -> Bool -> Bool -> Permissions _isAdmin :: Permissions -> Bool _isOwner :: Permissions -> Bool _isPrimaryOwner :: Permissions -> Bool _isRestricted :: Permissions -> Bool _isUltraRestricted :: Permissions -> Bool _isBot :: Permissions -> Bool data Profile Profile :: Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> URL -> URL -> URL -> URL -> URL -> Profile _profileFirstName :: Profile -> Maybe Text _profileLastName :: Profile -> Maybe Text _profileRealName :: Profile -> Maybe Text _profileRealNameNormalized :: Profile -> Maybe Text _profileTitle :: Profile -> Maybe Text _progileEmail :: Profile -> Maybe Text _profileSkype :: Profile -> Maybe Text _profilePhone :: Profile -> Maybe Text _profileImage24 :: Profile -> URL _profileImage32 :: Profile -> URL _profileImage48 :: Profile -> URL _profileImage72 :: Profile -> URL _profileImage192 :: Profile -> URL progileEmail :: Lens' Profile (Maybe Text) profileTitle :: Lens' Profile (Maybe Text) profileSkype :: Lens' Profile (Maybe Text) profileRealNameNormalized :: Lens' Profile (Maybe Text) profileRealName :: Lens' Profile (Maybe Text) profilePhone :: Lens' Profile (Maybe Text) profileLastName :: Lens' Profile (Maybe Text) profileImage72 :: Lens' Profile URL profileImage48 :: Lens' Profile URL profileImage32 :: Lens' Profile URL profileImage24 :: Lens' Profile URL profileImage192 :: Lens' Profile URL profileFirstName :: Lens' Profile (Maybe Text) isUltraRestricted :: Lens' Permissions Bool isRestricted :: Lens' Permissions Bool isPrimaryOwner :: Lens' Permissions Bool isOwner :: Lens' Permissions Bool isBot :: Lens' Permissions Bool isAdmin :: Lens' Permissions Bool timezoneOffset :: Lens' Timezone Int timezoneLabel :: Lens' Timezone Text timezoneDesc :: Lens' Timezone (Maybe Text) type Username = Text instance FromJSON Profile instance Show Timezone instance Show Permissions instance Show Profile instance Show User instance FromJSON Timezone instance FromJSON Permissions instance FromJSON User module Web.Slack.Types.Topic type Purpose = Topic data Topic Topic :: Text -> Text -> Int -> Topic _topicValue :: Topic -> Text _topicCreator :: Topic -> Text _topicLastSet :: Topic -> Int topicValue :: Lens' Topic Text topicLastSet :: Lens' Topic Int topicCreator :: Lens' Topic Text instance FromJSON Topic instance Show Topic module Web.Slack.Types.Channel data Channel Channel :: ChannelId -> Text -> Time -> UserId -> Bool -> Bool -> Maybe [UserId] -> Maybe Topic -> Maybe Purpose -> Bool -> Maybe ChannelOpt -> Channel _channelId :: Channel -> ChannelId _channelName :: Channel -> Text _channelCreated :: Channel -> Time _channelCreator :: Channel -> UserId _channelIsArchived :: Channel -> Bool _channelIsGeneral :: Channel -> Bool _channelMembers :: Channel -> Maybe [UserId] _channelTopic :: Channel -> Maybe Topic _channelPurpose :: Channel -> Maybe Purpose _channelIsMember :: Channel -> Bool _channelOpt :: Channel -> Maybe ChannelOpt channelTopic :: Lens' Channel (Maybe Topic) channelPurpose :: Lens' Channel (Maybe Purpose) channelOpt :: Lens' Channel (Maybe ChannelOpt) channelName :: Lens' Channel Text channelMembers :: Lens' Channel (Maybe [UserId]) channelIsMember :: Lens' Channel Bool channelIsGeneral :: Lens' Channel Bool channelIsArchived :: Lens' Channel Bool channelId :: Lens' Channel ChannelId channelCreator :: Lens' Channel UserId channelCreated :: Lens' Channel Time instance FromJSON Channel instance Show Channel module Web.Slack.Types.Group data Group Group :: GroupId -> Text -> Time -> UserId -> Bool -> Bool -> [UserId] -> Topic -> Purpose -> Maybe ChannelOpt -> Bool -> Group _groupId :: Group -> GroupId _groupName :: Group -> Text _groupCreated :: Group -> Time _groupCreator :: Group -> UserId _groupIsArchived :: Group -> Bool _groupIsOpen :: Group -> Bool _groupMembers :: Group -> [UserId] _groupTopic :: Group -> Topic _groupPurpose :: Group -> Purpose _groupOpt :: Group -> Maybe ChannelOpt _groupIsGroup :: Group -> Bool groupTopic :: Lens' Group Topic groupPurpose :: Lens' Group Purpose groupOpt :: Lens' Group (Maybe ChannelOpt) groupName :: Lens' Group Text groupMembers :: Lens' Group [UserId] groupIsOpen :: Lens' Group Bool groupIsGroup :: Lens' Group Bool groupIsArchived :: Lens' Group Bool groupId :: Lens' Group GroupId groupCreator :: Lens' Group UserId groupCreated :: Lens' Group Time instance FromJSON Group instance Show Group module Web.Slack.Types.IM data IM IM :: IMId -> UserId -> Time -> Bool -> Bool -> Maybe ChannelOpt -> IM _imId :: IM -> IMId _imUser :: IM -> UserId _imCreated :: IM -> Time _imIsOpen :: IM -> Bool _imIsIm :: IM -> Bool _imOpt :: IM -> Maybe ChannelOpt imUser :: Lens' IM UserId imOpt :: Lens' IM (Maybe ChannelOpt) imIsOpen :: Lens' IM Bool imIsIm :: Lens' IM Bool imId :: Lens' IM IMId imCreated :: Lens' IM Time instance FromJSON IM instance Show IM module Web.Slack.Types.Comment data Comment Comment :: CommentId -> Time -> UserId -> Text -> Comment _commentId :: Comment -> CommentId _commentTimestamp :: Comment -> Time _commentUser :: Comment -> UserId _commentComment :: Comment -> Text commentUser :: Lens' Comment UserId commentTimestamp :: Lens' Comment Time commentId :: Lens' Comment CommentId commentComment :: Lens' Comment Text instance FromJSON Comment instance Show Comment module Web.Slack.Types.File data File File :: FileId -> Time -> Maybe Text -> Text -> Text -> Text -> Text -> UserId -> Mode -> Bool -> Bool -> Text -> Int -> FileUrl -> Thumbnail -> URL -> Maybe URL -> Maybe Preview -> Bool -> Bool -> [ChannelId] -> [ChannelId] -> Maybe Comment -> Int -> Int -> File _fileId :: File -> FileId _fileTimestamp :: File -> Time _fileName :: File -> Maybe Text _fileTitle :: File -> Text _fileMime :: File -> Text _filetype :: File -> Text _filePrettyType :: File -> Text _fileUser :: File -> UserId _fileMode :: File -> Mode _fileEditable :: File -> Bool _fileIsExternal :: File -> Bool _fileExternalType :: File -> Text _fileSize :: File -> Int _fileUrl :: File -> FileUrl _fileThumbs :: File -> Thumbnail _filePermalink :: File -> URL _fileEditLink :: File -> Maybe URL _filePreview :: File -> Maybe Preview _filePublic :: File -> Bool _filePublicShared :: File -> Bool _fileChannels :: File -> [ChannelId] _fileGroups :: File -> [ChannelId] _fileInitialComment :: File -> Maybe Comment _fileStars :: File -> Int _fileComments :: File -> Int data Mode Hosted :: Mode External :: Mode Snippet :: Mode Post :: Mode data Preview Preview :: Text -> Text -> Int -> Int -> Preview _previewText :: Preview -> Text _previewHighlight :: Preview -> Text _lines :: Preview -> Int _linesMore :: Preview -> Int data FileUrl URL :: Text -> Text -> Text -> Text -> FileUrl _access :: FileUrl -> Text _download :: FileUrl -> Text _private :: FileUrl -> Text _privateDownload :: FileUrl -> Text data Thumbnail Thumbnail :: Maybe URL -> Maybe URL -> Maybe URL -> Maybe URL -> Maybe Int -> Maybe Int -> Thumbnail _w64 :: Thumbnail -> Maybe URL _w80 :: Thumbnail -> Maybe URL _w360 :: Thumbnail -> Maybe URL _w360gif :: Thumbnail -> Maybe URL _width :: Thumbnail -> Maybe Int _height :: Thumbnail -> Maybe Int filetype :: Lens' File Text fileUser :: Lens' File UserId fileUrl :: Lens' File FileUrl fileTitle :: Lens' File Text fileTimestamp :: Lens' File Time fileThumbs :: Lens' File Thumbnail fileStars :: Lens' File Int fileSize :: Lens' File Int filePublicShared :: Lens' File Bool filePublic :: Lens' File Bool filePreview :: Lens' File (Maybe Preview) filePrettyType :: Lens' File Text filePermalink :: Lens' File URL fileName :: Lens' File (Maybe Text) fileMode :: Lens' File Mode fileMime :: Lens' File Text fileIsExternal :: Lens' File Bool fileInitialComment :: Lens' File (Maybe Comment) fileId :: Lens' File FileId fileGroups :: Lens' File [ChannelId] fileExternalType :: Lens' File Text fileEditable :: Lens' File Bool fileEditLink :: Lens' File (Maybe URL) fileComments :: Lens' File Int fileChannels :: Lens' File [ChannelId] privateDownload :: Lens' FileUrl Text private :: Lens' FileUrl Text download :: Lens' FileUrl Text access :: Lens' FileUrl Text width :: Lens' Thumbnail (Maybe Int) w80 :: Lens' Thumbnail (Maybe URL) w64 :: Lens' Thumbnail (Maybe URL) w360gif :: Lens' Thumbnail (Maybe URL) w360 :: Lens' Thumbnail (Maybe URL) height :: Lens' Thumbnail (Maybe Int) previewText :: Lens' Preview Text previewHighlight :: Lens' Preview Text linesMore :: Lens' Preview Int lines :: Lens' Preview Int instance FromJSON Mode instance Show Mode instance Show Preview instance Show FileUrl instance Show Thumbnail instance Show File instance FromJSON Preview instance FromJSON Thumbnail instance FromJSON FileUrl instance FromJSON File module Web.Slack.Types.Item data Item MessageItem :: ChannelId -> MessageUpdate -> Item FileItem :: File -> Item FileCommentItem :: File -> Comment -> Item ChannelItem :: ChannelId -> Item IMItem :: ChannelId -> Item GroupItem :: GroupId -> Item data MessageUpdate MessageUpdate :: UserId -> Text -> SlackTimeStamp -> Maybe Edited -> Maybe URL -> MessageUpdate _messageUpdateUser :: MessageUpdate -> UserId _messageUpdateText :: MessageUpdate -> Text _messageUpdateTime :: MessageUpdate -> SlackTimeStamp _messageUpdateEdited :: MessageUpdate -> Maybe Edited _messagePermalink :: MessageUpdate -> Maybe URL data Edited Edited :: UserId -> SlackTimeStamp -> Edited _editedUser :: Edited -> UserId _editTimestap :: Edited -> SlackTimeStamp messageUpdateUser :: Lens' MessageUpdate UserId messageUpdateTime :: Lens' MessageUpdate SlackTimeStamp messageUpdateText :: Lens' MessageUpdate Text messageUpdateEdited :: Lens' MessageUpdate (Maybe Edited) messagePermalink :: Lens' MessageUpdate (Maybe URL) editedUser :: Lens' Edited UserId editTimestap :: Lens' Edited SlackTimeStamp instance FromJSON Edited instance Show Edited instance Show MessageUpdate instance Show Item instance FromJSON MessageUpdate instance FromJSON Item module Web.Slack.Types.Bot data Bot Bot :: BotId -> Text -> BotIcons -> Bot _botId :: Bot -> BotId _botName :: Bot -> Text _botIcons :: Bot -> BotIcons data BotIcons BotIcons :: URL -> BotIcons _botIconImage48 :: BotIcons -> URL botName :: Lens' Bot Text botId :: Lens' Bot BotId botIcons :: Lens' Bot BotIcons botIconImage48 :: Iso' BotIcons URL instance FromJSON Bot instance FromJSON BotIcons instance Show BotIcons instance Show Bot module Web.Slack.Types.Event.Subtype data Subtype SBotMessage :: BotId -> Maybe Username -> Maybe BotIcons -> Subtype SMeMessage :: Subtype SMessageChanged :: MessageUpdate -> Subtype SChannelJoin :: Maybe UserId -> Subtype SMessageDeleted :: SlackTimeStamp -> Subtype SChannelLeave :: Subtype SChannelTopic :: Text -> Subtype SChannelPurpose :: Text -> Subtype SChannelName :: Text -> Text -> Subtype SChannelArchive :: [UserId] -> Subtype SChannelUnarchive :: Subtype SGroupJoin :: Maybe UserId -> Subtype SGroupLeave :: Subtype SGroupTopic :: Text -> Subtype SGroupPurpose :: Text -> Subtype SGroupName :: Text -> Text -> Subtype SGroupArchive :: [UserId] -> Subtype SGroupUnarchive :: Subtype SFileShare :: File -> Bool -> Subtype SFileComment :: File -> Comment -> Subtype SFileMention :: File -> Subtype subtype :: String -> Value -> Parser Subtype instance Show Subtype module Web.Slack.Types.Event type Domain = Text data Event Hello :: Event Message :: ChannelId -> Submitter -> Text -> SlackTimeStamp -> Maybe Subtype -> Maybe Edited -> Event HiddenMessage :: ChannelId -> Submitter -> SlackTimeStamp -> Maybe Subtype -> Event ChannelMarked :: ChannelId -> SlackTimeStamp -> Event ChannelCreated :: Channel -> Event ChannelJoined :: Channel -> Event ChannelLeft :: Channel -> Event ChannelDeleted :: ChannelId -> Event ChannelRename :: ChannelRenameInfo -> Event ChannelArchive :: ChannelId -> UserId -> Event ChannelUnarchive :: ChannelId -> UserId -> Event ChannelHistoryChanged :: SlackTimeStamp -> SlackTimeStamp -> SlackTimeStamp -> Event ImCreated :: UserId -> IM -> Event ImOpen :: UserId -> IMId -> Event ImClose :: UserId -> IMId -> Event ImMarked :: IMId -> SlackTimeStamp -> Event ImHistoryChanged :: SlackTimeStamp -> SlackTimeStamp -> SlackTimeStamp -> Event GroupJoined :: Group -> Event GroupLeft :: Group -> Event GroupOpen :: UserId -> GroupId -> Event GroupClose :: UserId -> GroupId -> Event GroupArchive :: GroupId -> Event GroupUnarchive :: GroupId -> Event GroupRename :: ChannelRenameInfo -> Event GroupMarked :: GroupId -> SlackTimeStamp -> Event GroupHistoryChanged :: SlackTimeStamp -> SlackTimeStamp -> SlackTimeStamp -> Event FileCreated :: File -> Event FileShared :: File -> Event FileUnshared :: File -> Event FilePublic :: File -> Event FilePrivate :: FileId -> Event FileChange :: File -> Event FileDeleted :: FileId -> SlackTimeStamp -> Event FileCommentAdded :: File -> Comment -> Event FileCommentEdited :: File -> Comment -> Event FileCommentDeleted :: File -> CommentId -> Event PresenceChange :: UserId -> Presence -> Event ManualPresenceChange :: Presence -> Event PrefChange :: Pref -> Event UserChange :: User -> Event TeamJoin :: User -> Event StarAdded :: UserId -> Item -> SlackTimeStamp -> Event StarRemoved :: UserId -> Item -> SlackTimeStamp -> Event EmojiChanged :: SlackTimeStamp -> Event CommandsChanged :: SlackTimeStamp -> Event TeamPrefChange :: Pref -> Event TeamRenameEvent :: Text -> Event TeamDomainChange :: URL -> Domain -> Event EmailDomainChange :: Domain -> SlackTimeStamp -> Event BotChanged :: Bot -> Event BotAdded :: Bot -> Event AccountsChanged :: Event UserTyping :: ChannelId -> UserId -> Event MessageResponse :: Int -> SlackTimeStamp -> Text -> Event MessageError :: Int -> SlackError -> Event NoEvent :: Event type Pref = (Text, Value) parseType :: Value -> Text -> Parser Event data Submitter UserComment :: UserId -> Submitter BotComment :: BotId -> Submitter System :: Submitter data ChannelRenameInfo ChannelRenameInfo :: ChannelId -> Text -> Time -> ChannelRenameInfo _channelRenameId :: ChannelRenameInfo -> ChannelId _channelRenameName :: ChannelRenameInfo -> Text _channelRenameCreated :: ChannelRenameInfo -> Time channelRenameName :: Lens' ChannelRenameInfo Text channelRenameId :: Lens' ChannelRenameInfo ChannelId channelRenameCreated :: Lens' ChannelRenameInfo Time instance FromJSON ChannelRenameInfo instance Show Submitter instance Eq Submitter instance Show ChannelRenameInfo instance Show Event instance FromJSON Event module Web.Slack.Types.ChannelOpt data ChannelOpt ChannelOpt :: SlackTimeStamp -> Int -> Event -> ChannelOpt _channelOptLastRead :: ChannelOpt -> SlackTimeStamp _channelOptUnreadCount :: ChannelOpt -> Int _channelOptLatest :: ChannelOpt -> Event channelOptUnreadCount :: Lens' ChannelOpt Int channelOptLatest :: Lens' ChannelOpt Event channelOptLastRead :: Lens' ChannelOpt SlackTimeStamp instance FromJSON ChannelOpt instance Show ChannelOpt module Web.Slack.Types.Session data SlackSession SlackSession :: Self -> Team -> [User] -> SlackTimeStamp -> [Channel] -> [Group] -> [IM] -> [Bot] -> Text -> SlackSession _slackSelf :: SlackSession -> Self _slackTeam :: SlackSession -> Team _slackUsers :: SlackSession -> [User] _slackLatestEventTs :: SlackSession -> SlackTimeStamp _slackChannels :: SlackSession -> [Channel] _slackGroups :: SlackSession -> [Group] _slackIms :: SlackSession -> [IM] _slackBots :: SlackSession -> [Bot] _slackCacheVersion :: SlackSession -> Text slackUsers :: Lens' SlackSession [User] slackTeam :: Lens' SlackSession Team slackSelf :: Lens' SlackSession Self slackLatestEventTs :: Lens' SlackSession SlackTimeStamp slackIms :: Lens' SlackSession [IM] slackGroups :: Lens' SlackSession [Group] slackChannels :: Lens' SlackSession [Channel] slackCacheVersion :: Lens' SlackSession Text slackBots :: Lens' SlackSession [Bot] instance Show SlackSession instance FromJSON SlackSession module Web.Slack.Config -- | Configuration options needed to connect to the Slack API data SlackConfig SlackConfig :: String -> SlackConfig -- | API Token for Bot slackApiToken :: SlackConfig -> String instance Show SlackConfig module Web.Slack.Types module Web.Slack.State newtype Slack s a Slack :: StateT (SlackState s) IO a -> Slack s a runSlack :: Slack s a -> StateT (SlackState s) IO a type SlackBot s = Event -> Slack s () data Metainfo Meta :: Connection -> Int -> Metainfo -- | Websockets connection _metaConnection :: Metainfo -> Connection -- | Unique message counter _msgCounter :: Metainfo -> Int data SlackState s SlackState :: Metainfo -> SlackSession -> s -> SlackState s -- | Information about the connection _meta :: SlackState s -> Metainfo -- | Information about the session at the start of the connection _session :: SlackState s -> SlackSession -- | User defined state _userState :: SlackState s -> s userState :: Lens (SlackState s_a1Kkl) (SlackState s_a1Lqw) s_a1Kkl s_a1Lqw session :: Lens' (SlackState s_a1Kkl) SlackSession meta :: Lens' (SlackState s_a1Kkl) Metainfo msgCounter :: Lens' Metainfo Int metaConnection :: Lens' Metainfo Connection slackLog :: Show a => a -> MonadIO m => m () counter :: Slack s Int connection :: Lens' (SlackState s) Connection instance Show s => Show (SlackState s) instance Monad (Slack s) instance Functor (Slack s) instance Applicative (Slack s) instance MonadState (SlackState s) (Slack s) instance MonadIO (Slack s) instance Show Metainfo module Web.Slack.Message -- | Send a message to the specified channel. -- -- If the message is longer than 4000 bytes then the connection will be -- closed. sendMessage :: ChannelId -> Text -> Slack s () instance ToJSON MessagePayload instance Show MessagePayload -- | This module exposes functionality to write bots which responds to -- Events sent by the RTM API. By using the user state parameter -- s complicated interactions can be established. -- -- This basic example echos every message the bot recieves. Other -- examples can be found in the examples directory. -- --
-- myConfig :: SlackConfig
-- myConfig = SlackConfig
-- { slackApiToken = "..." -- Specify your API token here
-- }
--
-- -- type SlackBot s = Event -> Slack s ()
-- echoBot :: SlackBot ()
-- echoBot (Message cid _ msg _ _ _) = sendMessage cid msg
-- echoBot _ = return ()
--
-- main :: IO ()
-- main = runBot myConfig echoBot ()
--
module Web.Slack
-- | Run a SlackBot. The supplied bot will respond to all events
-- sent by the Slack RTM API.
--
-- Be warned that this function will throw an IOError if the
-- connection to the Slack API fails.
runBot :: SlackConfig -> SlackBot s -> s -> IO ()
newtype Slack s a
Slack :: StateT (SlackState s) IO a -> Slack s a
runSlack :: Slack s a -> StateT (SlackState s) IO a
type SlackBot s = Event -> Slack s ()
data SlackState s
SlackState :: Metainfo -> SlackSession -> s -> SlackState s
-- | Information about the connection
_meta :: SlackState s -> Metainfo
-- | Information about the session at the start of the connection
_session :: SlackState s -> SlackSession
-- | User defined state
_userState :: SlackState s -> s
userState :: Lens (SlackState s_a1Kkl) (SlackState s_a1Lqw) s_a1Kkl s_a1Lqw
session :: Lens' (SlackState s_a1Kkl) SlackSession