I am trying to update messages posted by my bot. However, I am getting a 'cant_update_message' error when trying to call chat.update. This is what my call looks like:
oauth_token = os.environ.get("OAUTH_TOKEN")
sc=SlackClient(oauth_token)
sc.api_call("chat.update", channel=channel_id, text=text, ts=ts)
I have also tried the Bot OAuth Token instead of the OAuth token, as well as all combinations of as_user (True, False, the bot's user ID...) without success.
Also, please notice that the channel and timestamp have been tested and are correct; I am able to update the messages by using the OAuth token when the message has been posted by me and I am the one invoking it through a slash command.
I am new to Slack API development. Can you let me know what I need to do to get it working?
Also, is it possible to customize other settings (like username and icon_url) when posting a message via chat.update? This is an important feature, as my bot sometimes posts using different display names and icons.