Learn R Programming

slackr (version 2.3.0)

slackr_msg: Sends a message to a slack channel.

Description

Sends a message to a slack channel.

Usage

slackr_msg(
  txt = "",
  channel = Sys.getenv("SLACK_CHANNEL"),
  username = Sys.getenv("SLACK_USERNAME"),
  icon_emoji = Sys.getenv("SLACK_ICON_EMOJI"),
  bot_user_oauth_token = Sys.getenv("SLACK_BOT_USER_OAUTH_TOKEN"),
  ...
)

Arguments

txt

text message to send to Slack. If a character vector of length > 1 is passed in, they will be combined and separated by newlines.

channel

which channel to post the message to (chr)

username

what user should the bot be named as (chr)

icon_emoji

what emoji to use (chr) "" will mean use the default

bot_user_oauth_token

Slack bot user OAuth token

...

other arguments passed to the Slack API chat.postMessage call

Value

the response (invisibly)

See Also

slackr_setup(), slackr_bot(), slackr_dev(), slackr_save(), slackr_upload()

Examples

Run this code
# NOT RUN {
slackr_setup()
slackr_msg("Hi")
# }

Run the code above in your browser using DataLab