The chat_update method fails to update messages that use blocks when text is used for the update. This happens despite the request response having "ok": True.
x in one of the [ ])x in each of the [ ])Filling out the following details about bugs will help us solve your issue sooner.
slackclient version: 2.2.0
python version: 3.7
OS version(s): macOS 10.14.6
The message should update
Nothing happens (but ok is received in response)
The ok: true response means the text attribute is successfully updated (but it's not visible for humans). It's possible to remove the blocks by giving an empty array as below:
import slack
client = slack.WebClient(token='xoxb-xxx-xxx-xxx')
post_resp = client.chat_postMessage(
channel='C12345678',
user='U12345678',
text='initial',
blocks=[
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "This is a mrkdwn section block :ghost: *this is bold*, and ~this is crossed out~, and <https://google.com|this is a link>"
}
}
]
)
print(post_resp)
ts = post_resp['message']['ts']
update_resp = client.chat_update(
channel='C12345678',
user='U12345678',
ts=ts,
text='modified',
blocks=[]
)
print(update_resp)
I've answered this question then. Allow me to close this issue now. If you have something to ask/discuss further, please feel free to reopen it.
Most helpful comment
The
ok: trueresponse means thetextattribute is successfully updated (but it's not visible for humans). It's possible to remove theblocksby giving an empty array as below: