Safe Haskell | Safe-Inferred |
---|
This provides wrappers for the various types of data supplied by the Slack API, so that any processing of the API data remains type-safe. No constructors are directly exported to allow for flexibility with the currently-beta Slack API.
- data Token
- getToken :: Token -> Text
- setToken :: Text -> Token
- data TeamID
- getTeamID :: TeamID -> Text
- setTeamID :: Text -> TeamID
- data ChannelID
- getChanID :: ChannelID -> Text
- setChanID :: Text -> ChannelID
- data ChannelName
- getChanName :: ChannelName -> Text
- getPoundChan :: ChannelName -> Text
- setChanName :: Text -> ChannelName
- data UserID
- getUserID :: UserID -> Text
- setUserID :: Text -> UserID
- data UserName
- getUserName :: UserName -> Text
- getAtUserName :: UserName -> Text
- setUserName :: Text -> UserName
- data Command
- getCommand :: Command -> Text
- getSlashCom :: Command -> Text
- setCommand :: Text -> Command
- data Channel
- = DirectMsg !UserName
- | Channel !ChannelName
- getAddress :: Channel -> Text
Slack types
Token
Team ID
Channel ID
Channel name
getChanName :: ChannelName -> TextSource
get the text value of a channel name
getPoundChan :: ChannelName -> TextSource
get the text value of a channel name, prefixed with a #
setChanName :: Text -> ChannelNameSource
make a channel name of the given text value
User ID
User name
getUserName :: UserName -> TextSource
get the text value of a username
getAtUserName :: UserName -> TextSource
get the text value of a username prefixed with a @
setUserName :: Text -> UserNameSource
make a username of given text value
Command
getCommand :: Command -> TextSource
get the text name of a command
getSlashCom :: Command -> TextSource
get the text name of a command prefixed with a /
setCommand :: Text -> CommandSource
make a command with the given name
Native types
Channel
Slack channels are either regular channels or direct messages to users
getAddress :: Channel -> TextSource
Get the text representation of a channel, with the appropriate prefix required by Slack