Skip to content

Interact with chats and files methods of Slack API in R

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

yonicd/slackposts

Repository files navigation

slackposts

Lifecycle: experimental Covrpage Summary R-CMD-check Codecov test coverage

slackposts is a part of slackverse

slackcalls
slackthreads
slackteams
slackposts
slackblocks
slackreprex

slackposts is an R package that allows the user to interact with slack API chat messages, snippets and files from R.

Installation

remotes::install_github("yonicd/slackposts")

Usage

Token

First you need a Slack API Token, to learn how to create one go to slackteams or set it directly as the environment variable Sys.setenv('SLACK_API_TOKEN').

Load

library(slackposts)

Chats

Post a message

chat_post(
  channels = "general",
  text = 'my message'
  )

Update a message

chat_update(
  post = slackposts::post_last(),
  text = 'my updated message'
  )

Delete Message

chat_delete(
  post = slackposts::post_last()
  )

Files

Create a temp file

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

Post the file

file_post(
  channels = "general",
  file = tf,
  filename = 'sessionInfo.R',
  filetype = 'r',
  title = 'R sessionInfo'
)

Delete the file

file_delete(file_last())

About

Interact with chats and files methods of Slack API in R

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages