Returns a dataframe of post history in a channel.
slackr_history(
message_count = 100,
channel = Sys.getenv("SLACK_CHANNEL"),
token = Sys.getenv("SLACK_TOKEN"),
posted_to_time = as.numeric(Sys.time()),
duration = NULL,
posted_from_time = 0,
paginate = FALSE,
inclusive = TRUE
)
A tibble
with message metadata
The number of messages to retrieve (only when paginate = FALSE
).
Corresponds to limit
in the conversations.history docs.
Note: If using pagination, setting a value of (e.g.) 1 will result in paginating
through the channel's history one message at a time. Slack recommends using a value of 200. (Default: 100)
Channel, private group, or IM channel to send message to. Can be an encoded ID, or a name.
Authentication token bearing required scopes.
Timestamp of the last post to consider.
Corresponds to latest
in the conversations.history docs.
Default: current time.
Number of hours of history to retrieve. If neither duration
nor posted_from_time
is specified, there is no time limit on the retrieved
history. (default: NULL
)
Timestamp of the first post time to consider. If both
posted_to_time and duration is specifed, they take precedence.
Corresponds to oldest
in the conversations.history
docs.
Default: 0
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.
Include messages with oldest or latest timestamps in results. Ignored unless either timestamp is specified.
You need one or more of these scopes enabled in your slack app: * channels:history * groups:history * im:history * mpim:history