Setting up the multi-functional bot is slightly more complex than the single-channel one.
channels:readusers:readfiles:readgroups:readgroups:writechat:writechat:write.customizechat:write.publicim:writeincoming-webhookchannels:historyslackr_setup(channel = '#channel_with_webhook',
bot_user_oauth_token = 'your_token',
incoming_webhook_url = 'your_webhook')You can also follow the config file setup directions below instead of passing the channel, token, and webhook directly.
And that’s it! You should be able to post a message with slackr('test message')
Without all of the scopes enabled, only certain functions will work. Which ones depends on which scopes you have enabled. See the function documentation for which scopes are needed for that function.
library(slackr)
slackr_setup(
channel="#channel",
incoming_webhook_url="https://hooks.slack.com/services/XXXXX/XXXXX/XXXXX",
bot_user_oauth_token='token'
)
slackr(str(iris))
# send images
library(ggplot2)
qplot(mpg, wt, data=mtcars)
slackr_dev("#results")
barplot(VADeaths)
slackr_dev("@jayjacobs")
ggslackr(qplot(mpg, wt, data=mtcars))slackr_texThe new function slackr_tex in versions 2.0.0+ requires package texPreview which is lazy-loaded when the former is called.
For setting up LaTeX see texPreview’s System Requirements, and for specific OS setup check out its Github Actions like this MacOS example.