Learn R Programming

slackr (version 2.3.0)

slackr_history: Reads history of a channel.

Description

Returns a dataframe of post history in a channel.

Usage

slackr_history(
  channel = Sys.getenv("SLACK_CHANNEL"),
  bot_user_oauth_token = Sys.getenv("SLACK_BOT_USER_OAUTH_TOKEN"),
  posted_to_time = as.numeric(Sys.time()),
  message_count,
  duration,
  posted_from_time,
  paginate = FALSE
)

Arguments

channel

The channel to get history from

bot_user_oauth_token

the Slack bot user OAuth token

posted_to_time

Timestamp of the last post to consider (default: current time)

message_count

The number of messages to retrieve (only when paginate = FALSE)

duration

Number of hours of history to retrieve. By default retrieves 24 hours of history.

posted_from_time

Timestamp of the first post time to consider

paginate

If TRUE, uses the Slack API pagination mechanism, and will retrieve all history inside the timeframe. Otherwise, makes a single call to the API and retrieves a maximum of message_count messages

Value

A tibble with message metadata

Scopes

You need one or more of these scopes enabled in your slack app: * channels:history * groups:history * im:history * mpim:history

References

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