I am trying to update a Slack message's button style and text using a bot, but I can not find information regarding updating individual blocks, rather than the array as a whole. How can I only update "text" and "style" of the res_but element, while keeping the rest of the message contents?
EDIT: I forgot to mention that I am using Python3 and Bolt to program this
@app.action("res_but")
def resolve_toggle(ack, body, client):
ack()
resolvebutton_style = body["actions"][0]["style"]
if(resolvebutton_style == "danger"):
client.chat_update(
channel = body["channel"]["id"],
ts = body["message"]["ts"],
blocks=[
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Issue:*\n{}\n*Urgency:*\n{}\n*Posted By*:\n{}\n*When:*\n<!date^{}^Posted {{date_num}} {{time_secs}}|Null Date>\n*Last Update:*\n".format(msg, urgency_val, username, posttimest_int)
}
},
{
"block_id": "issue_buttons",
"type": "actions",
"elements": [
{
"action_id": "res_but",
"type": "button",
"text": {
"type": "plain_text",
"emoji": True,
"text": "Resolved" #issue status changed to resolved
},
"style": "primary", #color changed to primary
"value": "resolve_but"
},
{
"action_id": "ogmes_but",
"type": "button",
"text": {
"type": "plain_text",
"emoji": True,
"text": "Original Message"
},
"value": "og_message"
}
]
}
]
)