slack-web-0.2.0.11: Bindings for the Slack web API

Safe HaskellNone
LanguageHaskell2010

Web.Slack

Description

 
Synopsis

Documentation

data SlackConfig Source #

Implements the HasManager and HasToken typeclasses.

Instances
HasToken SlackConfig Source # 
Instance details

Defined in Web.Slack

HasManager SlackConfig Source # 
Instance details

Defined in Web.Slack

mkSlackConfig :: Text -> IO SlackConfig Source #

Prepare a SlackConfig from a slack token. You can then call the other functions providing this in a reader context.

authTest :: (MonadReader env m, HasManager env, HasToken env, MonadIO m) => m (Response TestRsp) Source #

Check authentication and identity.

https://api.slack.com/methods/auth.test

channelsHistory :: (MonadReader env m, HasManager env, HasToken env, MonadIO m) => HistoryReq -> m (Response HistoryRsp) Source #

Retrieve channel history. Consider using historyFetchAll in combination with this function

https://api.slack.com/methods/channels.history

groupsHistory :: (MonadReader env m, HasManager env, HasToken env, MonadIO m) => HistoryReq -> m (Response HistoryRsp) Source #

This method returns a portion of messages/events from the specified private channel. To read the entire history for a private channel, call the method with no latest or oldest arguments, and then continue paging. Consider using historyFetchAll in combination with this function

https://api.slack.com/methods/groups.history

groupsList :: (MonadReader env m, HasManager env, HasToken env, MonadIO m) => m (Response ListRsp) Source #

This method returns a list of private channels in the team that the caller is in and archived groups that the caller was in. The list of (non-deactivated) members in each private channel is also returned.

https://api.slack.com/methods/groups.list

historyFetchAll Source #

Arguments

:: (MonadReader env m, HasManager env, HasToken env, MonadIO m) 
=> (HistoryReq -> m (Response HistoryRsp))

The request to make. Can be for instance mpimHistory, channelsHistory...

-> Text

The channel name to query

-> Int

The number of entries to fetch at once.

-> SlackTimestamp

The oldest timestamp to fetch records from

-> SlackTimestamp

The newest timestamp to fetch records to

-> m (Response HistoryRsp)

A list merging all the history records that were fetched through the individual queries.

Fetch all history items between two dates. The basic calls channelsHistory, groupsHistory, imHistory and so on may not return exhaustive results if there were too many records. You need to use historyRspHasMore to find out whether you got all the data.

This function will repeatedly call the underlying history function until all the data is fetched or until a call fails, merging the messages obtained from each call.

imHistory :: (MonadReader env m, HasManager env, HasToken env, MonadIO m) => HistoryReq -> m (Response HistoryRsp) Source #

Retrieve direct message channel history. Consider using historyFetchAll in combination with this function

https://api.slack.com/methods/im.history

imList :: (MonadReader env m, HasManager env, HasToken env, MonadIO m) => m (Response ListRsp) Source #

Returns a list of all direct message channels that the user has

https://api.slack.com/methods/im.list

mpimList :: (MonadReader env m, HasManager env, HasToken env, MonadIO m) => m (Response ListRsp) Source #

Returns a list of all multiparty direct message channels that the user has

https://api.slack.com/methods/mpim.list

mpimHistory :: (MonadReader env m, HasManager env, HasToken env, MonadIO m) => HistoryReq -> m (Response HistoryRsp) Source #

Retrieve multiparty direct message channel history. Consider using historyFetchAll in combination with this function

https://api.slack.com/methods/mpim.history

getUserDesc Source #

Arguments

:: (UserId -> Text)

A function to give a default username in case the username is unknown

-> ListRsp

List of users as known by the slack server. See usersList.

-> UserId -> Text

A function from UserId to username.

Returns a function to get a username from a UserId. Comes in handy to use messageToHtml

usersList :: (MonadReader env m, HasManager env, HasToken env, MonadIO m) => m (Response ListRsp) Source #

This method returns a list of all users in the team. This includes deleted/deactivated users.

https://api.slack.com/methods/users.list

class HasManager a where Source #

Methods

getManager :: a -> Manager Source #

Instances
HasManager SlackConfig Source # 
Instance details

Defined in Web.Slack

class HasToken a where Source #

Methods

getToken :: a -> Text Source #

Instances
HasToken SlackConfig Source # 
Instance details

Defined in Web.Slack