I am currently trying to create a slack - R integration to create an alert when specific rules / threshold is hit. I'm using slackr package (v. 2.1.0)
The only function that is working right now is only slackr::slackr_bot as it successfully send a bot message into the private channels.
start <- paste0("Start checking the anomaly")
slackr::slackr_bot(start, incoming_webhook_url=whurl )
and it return a slack notifications below:

When I am trying to set the initial slackr_setup with below command (I believe it is needed for more functions like sending image, post) it keep getting error. Below are the script used:
slackr::slackr_setup(channel = "test_slack_alert_mn",
username = '@Alert System',
icon_emoji = "",
incoming_webhook_url = whurl, #variable from slack app
bot_user_oauth_token = apitk, #oauth_token from slack app
echo = FALSE
)
This is the error message:
Error in if (nrow(chan) == 0) { : argument is of length zero
Do you guys know what happen here and what should I do to solve this?
Thank you in advance!