haskbot-core-0.1: Easily-extensible chatbot for Slack messaging service

Safe HaskellSafe-Inferred

Network.Haskbot.Types

Contents

Description

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.

Synopsis

Slack types

Token

data Token Source

Instances

getToken :: Token -> TextSource

get the text of a token

setToken :: Text -> TokenSource

make a token of the given text

Team ID

data TeamID Source

Instances

getTeamID :: TeamID -> TextSource

get the text value of a team ID

setTeamID :: Text -> TeamIDSource

make a team ID of the given text value

Channel ID

getChanID :: ChannelID -> TextSource

get the text value of a channel ID

setChanID :: Text -> ChannelIDSource

make a channel ID of the given text value

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

data UserID Source

Instances

getUserID :: UserID -> TextSource

get the text value of a user ID

setUserID :: Text -> UserIDSource

make a user ID of the given text value

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

data Channel Source

Slack channels are either regular channels or direct messages to users

Instances

getAddress :: Channel -> TextSource

Get the text representation of a channel, with the appropriate prefix required by Slack