Closed adrian-pascual closed 3 years ago
@adrian-pascual I'll look into this tonight
In the meantime, try just doing slackr(text = "testing", channel = "#data-test")
.
@mrkaye97, running into the same error, almost positive this is because slack_users()
is returning an empty data frame within slackr()
, which breaks the dplyr:::left_join.data.frame(users, ims, by = "id")
slackr_users(bot_user_oauth_token)
# data frame with 0 columns and 0 rows
@adrian-pascual yep, this is my guess too. I'll see if I can replicate this locally tonight. What's in your config file? Also, what scopes do you have turned on?
I actually managed to get slackr_users(bot_user_oauth_token)
to return a data frame with more scopes! I have all the scopes except for the identity ones and the admin ones.
However, still getting the same error message when I run slackr_msg
, the issue now is that r chan <- slackr::slackr_channels(bot_user_oauth_token)
only returns public and not private channels. This causes an error if the channel I use for the slack_msg(channel = test-channel)
is private. Assuming there's no way to fix this without manually adding the private channel to this line.
@adrian-pascual great news! Thanks for the update. Actually, it's this line that deals with private channels, and that should be set up okay. this is probably still a scopes issue, I assume. If you're going to dig around in which scopes are needed, would you mind recording them by the way? That'd be a great resource, since I don't actually know and this seems to be a constant issue.
Edit: FYI, you can test that the requests are working here: https://api.slack.com/methods/conversations.list/test
Ah ok, at this point the only scopes I haven't added are Admin ones, but I don't have Admin privileges for the Slack Workspace I'm in, so I assume a scope like admin.usergroups:read
would be necessary
You shouldn't need any of the admin scopes. These are the ones I have:
@adrian-pascual I just tested a private channel on my machine, and am having the same issue. I then went to the Slack API here: https://api.slack.com/methods/conversations.list/test
I put in my bot user token from my Slack app, and put private_channel
in the types
box, and didn't see any private channels. As far as I can tell, this is an issue with the Slack API. These are the scopes I have enabled.
If you play around with it and find a scope that lets private channels show up, please report back because that'd be great info. Thanks, and sorry about this!
Thanks for testing @mrkaye97! Quite relieved that you're helping manage this package, it was inactive for a while and didn't think it would ever be updated.
When using slackr v2.0 after running
slackr_setup(config_file = "~/file/path")
,slackr_msg()
encounters this error:Checked where the error was occurring with
rlang::last_error()
slacker_ims(bot_user_oauth_token)
also fails with the same error. Any wisdom on this? My initial hunch was that it's an API scope issue but I've added a bunch of scopes to the Slack app and seen nothing change.