﻿---
sidebar_position: 3
description: Edit message and other functions to work with Slack in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, Slack]
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Edit message
 Edits the content of an existing message



`Function EditMessage(Val Token, Val Channel, Val Timestamp, Val Text = "", Val BlockArray = "") Export`

  | Parameter | CLI option | Type | Required | Description |
  |-|-|-|-|-|
  | Token | --token | String | &#x2714; | Bot token |
  | Channel | --channel | String | &#x2714; | Channel ID |
  | Timestamp | --stamp | String | &#x2714; | Message timestamp |
  | Text | --text | String | &#x2716; | New message text |
  | BlockArray | --blocks | Array of Structure | &#x2716; | JSON array of block descriptions |

  
  Returns:  Map Of KeyAndValue - serialized JSON response from Slack

<br/>




```bsl title="1C:Enterprise/OneScript code example"
    Token     = "xoxb-6965308400114-696804637...";
    Channel   = "C06UFNUTKUL";
    Timestamp = "1747771991.004039";

    Text = "TestMessage2";

    Result = OPI_Slack.EditMessage(Token, Channel, Timestamp, Text);
```
 

 <Tabs>
  
    <TabItem value="bash" label="Bash" default>
        ```bash
            oint slack EditMessage \
             --token "***" \
             --channel "C06UFNUTKUL" \
             --stamp "1747808572.345919" \
             --text "TestMessage2"
        ```
    </TabItem>
  
    <TabItem value="bat" label="CMD/Bat" default>
        ```batch
            oint slack EditMessage ^
             --token "***" ^
             --channel "C06UFNUTKUL" ^
             --stamp "1747808572.345919" ^
             --text "TestMessage2"
        ```
    </TabItem>
</Tabs>


```json title="Result"
{
 "ok": true,
 "channel": "C06UFNUTKUL",
 "ts": "1728454508.757479",
 "text": "TestMessage2",
 "message": {
  "user": "U06UG1CAYH2",
  "type": "message",
  "edited": {
   "user": "B06TZ0MJV5M",
   "ts": "1728454510.000000"
  },
  "bot_id": "B06TZ0MJV5M",
  "app_id": "A06TYNH45RV",
  "text": "TestMessage2",
  "team": "T06UD92BS3C",
  "bot_profile": {
   "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": [
   {
    "type": "rich_text",
    "block_id": "0dMq",
    "elements": [
     {
      "type": "rich_text_section",
      "elements": [
       {
        "type": "text",
        "text": "TestMessage2"
       }
      ]
     }
    ]
   }
  ]
 }
}
```
