chat_slack: Interact with Chat API

View source: R/generics.R

chat_slackR Documentation

Interact with Chat API

Description

Post/edit/delete messages or blocks to a channel

Usage

chat_slack(
  slack_method = "chat.postMessage",
  token = Sys.getenv("SLACK_API_TOKEN"),
  ...,
  action = c("push", "pop"),
  rate_limit
)

Arguments

slack_method

character, method to invoke, Default: 'chat.postMessage'

token

Character. Your Slack API token.

...

arguments to pass to chat methods

action

action to apply on.exit to call stack, Default: c("push", "pop")

rate_limit

Integer. The maximum number of calls to make to this function per minute. If NULL, calls will not be rate-limited. If unset, calls will be limited per the rate limit guides in the Slack api method documentation, if known. Note: If a limit is set for this method in any call in this session, that rate limit will be respected until rate_limit is set to NULL. Default: None.

Details

chat methods available to post to

  • chat.postMessage

  • chat.delete

  • chat.update

For a full list of chat methods see here

Value

httr response

Examples

## Not run: 
chat_slack(
  text = 'my message',
  channel = "general",
  token = "my_api_token"
)

## End(Not run)

yonicd/slackcalls documentation built on March 12, 2023, 4:38 p.m.