1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-04-13 11:50:53 +02:00

91 lines
2.0 KiB
Markdown
Raw Normal View History

---
sidebar_position: 3
---
# Edit message
Edits the content of an existing message
2024-07-10 13:58:29 +03:00
`Function EditMessage(Val Token, Val Channel, Val Timestamp, Val Text = "", Val BlockArray = "") Export`
| Parameter | CLI option | Type | Description |
|-|-|-|-|
| Token | --token | String | Bot token |
| Channel | --channel | String | Channel ID |
| Timestamp | --stamp | String | Message timestamp |
| Text | --text | String | New message text |
| BlockArray | --blocks | Array of Structure | JSON array of block descriptions |
2024-10-09 09:42:00 +03:00
Returns: Map Of KeyAndValue - serialized JSON response from Slack
2024-07-10 14:05:58 +03:00
<br/>
2024-07-10 13:58:29 +03:00
```bsl title="Code example"
2024-09-29 12:34:39 +03:00
Token = "xoxb-6965308400114-696804637...";
Channel = "C06UFNUTKUL";
2024-10-15 10:07:27 +03:00
Timestamp = "1728823163.597989";
2024-09-29 12:34:39 +03:00
Text = "TestMessage2";
Result = OPI_Slack.EditMessage(Token, Channel, Timestamp, Text);
```
2024-10-15 09:53:37 +03:00
```json title="Result"
2024-08-14 09:06:31 +03:00
{
2024-10-06 16:55:08 +03:00
"ok": true,
"channel": "C06UFNUTKUL",
2024-10-09 09:42:00 +03:00
"ts": "1728454508.757479",
2024-10-06 16:55:08 +03:00
"text": "TestMessage2",
"message": {
"user": "U06UG1CAYH2",
"type": "message",
2024-10-06 16:55:08 +03:00
"edited": {
"user": "B06TZ0MJV5M",
2024-10-09 09:42:00 +03:00
"ts": "1728454510.000000"
2024-10-06 16:55:08 +03:00
},
"bot_id": "B06TZ0MJV5M",
"app_id": "A06TYNH45RV",
"text": "TestMessage2",
"team": "T06UD92BS3C",
"bot_profile": {
2024-10-06 16:55:08 +03:00
"id": "B06TZ0MJV5M",
"app_id": "A06TYNH45RV",
"name": "OpenIntegrations",
"icons": {
"image_36": "https://a.slack-edge.com/80588/img/plugins/app/bot_36.png",
"image_48": "https://a.slack-edge.com/80588/img/plugins/app/bot_48.png",
"image_72": "https://a.slack-edge.com/80588/img/plugins/app/service_72.png"
},
"deleted": false,
"updated": 1713205238,
"team_id": "T06UD92BS3C"
},
"blocks": [
2024-10-06 16:55:08 +03:00
{
"type": "rich_text",
2024-10-09 09:42:00 +03:00
"block_id": "0dMq",
2024-10-06 16:55:08 +03:00
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "text",
"text": "TestMessage2"
}
]
}
]
}
]
2024-10-06 16:55:08 +03:00
}
}
```