1

We just started last week with using stack to keep up with our community. I am looking for a way to easy monitor the user statistics, possibilities to post some results from r and maybe make an easy notification tool for new members or even a bot that sent welcome messages to new members.

I read a lot about the stackr package, but I cannot find any clear examples of how to make that connection from r with stack.

I think even the connection I made did fail, but I am not getting any errors that are helpful.

This is the code I have so far:

library(slackr)


slackr_setup(channel = "#testchannel", username = "slackr", icon_emoji = "",
             incoming_webhook_url = "https://OURWORKSPACE.slack.com/services/hooks/incoming-webhook?", api_token = "", config_file = "~/.slackr",
             echo = FALSE)

and

slackr("Hello", channel = "#testchannel", username = "slackr", icon_emoji = "",
             incoming_webhook_url = "https://OURWORKSPACE.slack.com/services/hooks/incoming-webhook?", api_token = "", config_file = "~/.slackr",
             echo = FALSE)

After running those two steps, I receive the error:

Error: No token specified. Did you forget to call slackr_setup()?

Is there anyone that has clear examples or can help me get started to make the connection between r and stack?

zx8754
  • 52,746
  • 12
  • 114
  • 209
Lyanne
  • 11
  • 1
  • Welcome to SO! Just to be sure it is not something simple going on. Did you create an app in slack and got an api token? In the code you posted the token is empty and I am not sure if it is just to hide it. Also when I used incoming webhooks URL looked like: `https://hooks.slack.com/services/XXXXX/XXXXX/XXXXX` – alko989 Dec 11 '18 at 09:33
  • Well I think that is the part where it goes wrong then, because I could not find these kind of steps in the examples from slackr. I did add the webhook-incoming app to slack, but I am not sure how to configure it, so I just followed the standard settings except for the topic, I set that to #testchannel. – Lyanne Dec 11 '18 at 10:30
  • You can start here: https://api.slack.com/slack-apps and create an app in slack, link it to a channel in your workspace, get a token and a webhook link – alko989 Dec 11 '18 at 10:37

0 Answers0