2

I'm trying to use chat.delete on a "user" channel, the same as you do with chat.postMessage, however I keep getting a channel_not_found error.

slack.api_call(
        "chat.delete",
        channel=userID, # Exact same value as used with chat.postMessage
        ts=ts
    )

Is this a limitation in their API? Is there a way to achieve this?

Naatan
  • 3,424
  • 4
  • 32
  • 51

1 Answers1

1

Turns out chat.postMessage will use the SlackBot channel when addressing a single user. The proper way of communicating via IM with a user is to use conversations.open. When I used that everything works as expected.

Naatan
  • 3,424
  • 4
  • 32
  • 51
  • 1
    There is a "hack" which does not require conversations.open: check this answer: https://stackoverflow.com/a/54930102/4379151 – Erik Kalkoken May 05 '19 at 18:26