Learn R Programming

slackr (version 2.3.0)

create_config_file: Create the config file used in slackr_setup()

Description

Create the config file used in slackr_setup()

Usage

create_config_file(
  filename = "~/.slackr",
  bot_user_oauth_token = Sys.getenv("SLACK_BOT_USER_OAUTH_TOKEN"),
  incoming_webhook_url = Sys.getenv("SLACK_INCOMING_URL_PREFIX"),
  icon_emoji = Sys.getenv("SLACK_ICON_EMOJI"),
  username = Sys.getenv("SLACK_USERNAME"),
  channel = Sys.getenv("SLACK_CHANNEL")
)

Arguments

filename

the name of the config file to save. We recommend using a hidden file (starting with '.')

bot_user_oauth_token

the Slack bot user OAuth token (Default: whatever is set as an env var)

incoming_webhook_url

the incoming webhook URL (Default: whatever is set as an env var)

icon_emoji

the icon emoji to use as the default

username

the username to send messages from (will default to "slackr" if no username is set)

channel

the channel to send messages to (will default to "#general" if no channel is set)

Value

TRUE if successful (invisibly)

See Also

slackr_setup()

Examples

Run this code
# NOT RUN {
# using `create_config_file()` after `slackr_setup()`
create_config_file()

# using `create_config_file()` before `slackr_setup()`
create_config_file(bot_user_oauth_token = 'xox-',
  incoming_webhook_url = 'https://hooks-',
  channel = '#general',
  username = 'slackr',
  icon_emoji = 'tada')

slackr_setup()
# }

Run the code above in your browser using DataLab