file_manage: Interact with Files

snippet_postR Documentation

Interact with Files

Description

Send, list, retrieve information or Delete a file.

Usage

snippet_post(content, channels, ..., token = Sys.getenv("SLACK_API_TOKEN"))

file_post(file, channels, ..., token = Sys.getenv("SLACK_API_TOKEN"))

file_delete(file, token = Sys.getenv("SLACK_API_TOKEN"))

Arguments

content

character, content of snippet

channels

character, Channel ID(s) to post file

...

arguments to pass to API method.

token

Character. Your Slack API token. Default: Sys.getenv("SLACK_API_TOKEN")

file

character, file ID

Details

For a full list of arguments to pass to file methods see here

Value

A list with an additional class corresponding to slack_method.

Examples

## Not run: 
tf <- tempfile(fileext = '.r')
cat(
  utils::capture.output(utils::sessionInfo()),
  file = tf,
  sep = '\n'
)

#post the file
file_post(
  channels = "general",
  token = Sys.getenv('SLACK_API_TOKEN'),
  file = tf,
  filename = 'sessionInfo.R',
  filetype = 'r',
  title = 'R sessionInfo'
)

# delete the file
file_delete(file_last())

## End(Not run)

yonicd/slackposts documentation built on Sept. 7, 2024, 10:24 a.m.