Slackr: x Problem with `id` - Cannot send messages

Viewed 169

I am not an admin so I can't change the scopes. I can send slackr_bot messages to a channel I set up in the creation of the app in UI but doing the below does not work. Has anyone found a solution to this?

I created a txt file called: test.txt

Within that txt file it looks like this:

api_token: xxxxxxxxxxxx
channel: #channel_name
username: myusername
incoming_webhook_url: https://hooks.slack.com/services/xxxxxxxxxxx/xxxxxxxxxxxxx

Then I want to simply send a message but eventually I would like to run the function ggslackr(qplot(mpg, wt, data=mtcars))

slackr_setup(config_file = "test.txt")
my_message <- paste("I'm sending a Slack message at", Sys.time(), "from my R script.")
slackr_msg(my_message, channel = "#channel_name", as_user=F)

Here is the error message:

Error: Join columns must be present in data.
x Problem with `id`.
Run `rlang::last_error()` to see where the error occurred.
In addition: Warning message:
In structure(vars, groups = group_vars, class = c("dplyr_sel_vars",  :
  Calling 'structure(NULL, *)' is deprecated, as NULL cannot have attributes.
  Consider 'structure(list(), *)' instead.
1 Answers

Edit #2:

Okay, I learned some things regarding packages. If I had to do this over, I'd have gone to their github repo and read the issue tracker.

The reason is that it appears that slackr has a few issues related to changes in Slack's API.

And also since there has been a large updating of R (version 4.x) a lot of packages got broken.

My sense is that our issue is with a line of code inside a slackr function (slackr_util.r--iirc) that calls a dplyr join that is looking for a particular id that does not exist.

So, I'm going to watch the issue tracker and see what comes of it.


Edit: Try slackr_bot(my_message,channel = "#general")

worked as advertised!

But ggslackr continues to fail.


I'm having the same issue. I've found in another thread a debugging start:

`rlang::last_error()`

When I run that,

Backtrace:
  1. slackr::slackr_msg(my_message, channel = "#general")
  5. slackr::slackr_chtrans(channel)
  6. slackr::slackr_ims(api_token)
  8. dplyr:::left_join.data.frame(users, ims, by = "id", copy = TRUE)
  9. dplyr:::join_mutate(...)
 10. dplyr:::join_cols(...)
 11. dplyr:::standardise_join_by(by, x_names = x_names, y_names = y_names)
 12. dplyr:::check_join_vars(by$y, y_names)

So, step 8 there is a join effort by id, which I suppose this implies that 'id' is missing.

yet, if I run from github issue tracker : slackr::slackrSetup(echo=TRUE) I get the following:

{
  "SLACK_CHANNEL": ["#general"],
  "SLACK_USERNAME": ["slackr_brian"],
  "SLACK_ICON_EMOJI": ["NA"],
  "SLACK_INCOMING_URL_PREFIX": ["https://hooks.xxxxxxx"],
  "SLACK_API_TOKEN": ["token secret"]
} 

I'm not sure where to go from here as the issue tracker conversation makes mention of confirming webhooks going to the correct channel and becomes very user specific.

So, that's as far as I have gotten.

Related