I've replicated the problem on my own Slack workspace where I'm the owner and have full permissions. Anyone using the reprex below will have to insert their own token and webhook.
Here's what happens - I can post a message to either a private or a public channel, but then I can only retrieve the history, or delete posts, from the public channel, and not from the private channel.
As I have global permissions in this workspace, this seems like an inconsistency to me. Perhaps I misunderstand something.
Note that no errors are reported in the reprex, but the calls for history_slackr, or delete_slackr do not work for the private channel.
library(slackr)
packageVersion("slackr")
#> [1] '1.5.0'
username <- "slackr"
api_token <- "xoxp-xxxxxxxxxxxxx-xxxxxxxxxxxxxx-xxxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
incoming_webhook_url <- "https://hooks.slack.com/services/xxxxxxxxxxx/xxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# public channel "#random"
channel <- "#random"
slackr_setup(channel = channel,
username = username,
api_token = api_token,
incoming_webhook_url = incoming_webhook_url)
slackr("Test message: 1")
slackr_msg("Test message: 2")
slackr_bot("Test message: 3")
history_slackr(count = 3)
#> type subtype text ts username
#> 1 message bot_message ```Test message: 3\n``` 1548526424.001900 slackr
#> 2 message <NA> ```Test message: 2\n``` 1548526424.001800 <NA>
#> 3 message <NA> ```Test message: 1\n``` 1548526423.001700 <NA>
#> bot_id user
#> 1 BFP889P88 <NA>
#> 2 BFPCJLHEV UFRCNF2JJ
#> 3 BFPCJLHEV UFRCNF2JJ
delete_slackr(count = 3)
# private channel "slackr"
channel <- "slackr"
slackr_setup(channel = channel,
username = username,
api_token = api_token,
incoming_webhook_url = incoming_webhook_url)
slackr("Test message: 1")
slackr("Test message: 2")
slackr_bot("Test message: 3")
history_slackr(count = 3)
#> NULL
delete_slackr(count = 3)
Created on 2019-01-26 by the reprex package (v0.2.1)