1

I have a slack bot with a bot token and I want to use it to look for a previous message it has sent.

I originally tried to do something like

res = sc.api_call(
    "conversations.history",
    channel = channel_id,
    limit = 100,
    oldest = time.time() - 60*60*24
)

and then my plan was to search through that, but I need the channels:history scope, and I don't want to use the oauth flow for this.

Is there a way to do this?

swagrov
  • 1,510
  • 3
  • 22
  • 38

1 Answers1

-1

The problem was that I was using the same token for reading and writing. I'm not sure what the difference is, but I need to use the "Bot User OAuth Access Token" for posting on behalf of the bot, and "OAuth Access Token" for performing the actions that required the scopes, such as channels:history (which I added as a scope before)

swagrov
  • 1,510
  • 3
  • 22
  • 38
  • No, that is not the correct answer. you can use `channels.history` with both your bot and access token, as long as you have the correct scope. So there must be something else going on here in my opinion. – Erik Kalkoken Oct 17 '18 at 20:22