Closed achubaty closed 3 years ago
Ah, thanks @achubaty. The bot_user_oauth_token
was deprecated in slackr 2.4.0
in favor of token
, and was removed in slackr 3.0.0
. Note: The use of bot tokens was not deprecated. Only the name of the argument was changed.
I will update the vignette tonight to explain the change. Thanks again for pointing this out!
I'll also add a little bit of error handling, since that error you got isn't very helpful.
Alright @achubaty, #162 should close this issue and fix the documentation and error handling.
Re: channel specification -- which slackr
function are you using? slackr_bot
will only post to the channel that's attached to the webhook, and the channel
argument won't work
Thank you. I was previously able to set the channel and the user in the config file. Looks like it's only the user it is complaining about (sorry, I misread the error).
I have it working now.
Aha, sounds good! If you are using a user token (e.g. xoxp
), specifying a username won't do anything, since it'll post as you. Just to confirm: is that what you were seeing? It'd be great if you could post the error message -- then I'll know for sure and can merge #162 and ship these fixes
After getting rid of user
, my ~/.slackr
contains token
, incoming_webhook_url
, and channel
.
> slackr_setup()
[1] "Successfully connected to Slack"
Warning message:
You're using a user token but also specified the following parameter(s): NA, NA. These arguments will have no effect.
This warning is displayed once per session.
Sending a message, the username appears as NA
.
Ah, okay. this is another good one for me to fix! Thanks again!
Last thing @achubaty: Do you mind pasting your config file here (and removing the secrets, of course)? I can't reproduce this issue. The NA
NA
seems a little weird.
achubaty@machine:~$ cat ~/.slackr
token: xoxp-my_token
incoming_webhook_url: https://hooks.slack.com/services/my_webhook
Got it. thanks @achubaty. I still couldn't repro the NA
issue, but I've made an attempt at a patch in #162 which I'll merge now. Do you mind installing the latest dev version with devtools::install_github("mrkaye97/slackr")
and giving it a shot?
Not seeing the warning now. THanks!
Following the instructions here to setup a scoped bot token no longer works for
slackr
v3.0.0. Changingbot_user_oauth_token
totoken
works, but then this is treated as a single channel bot, and any channel specification is ignored.If using bot tokens is deprecated, the docs need updating -- and users need to be warned to setup personal tokens.