1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-03-31 22:05:13 +02:00

51 lines
1.3 KiB
Plaintext
Raw Normal View History

2024-10-15 10:50:56 +03:00
---
2024-10-15 10:16:04 +03:00
sidebar_position: 2
---
2024-10-15 10:50:56 +03:00
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
2024-10-15 10:16:04 +03:00
# Send ephemeral message
Sends a message that arrives in the channel but is visible only to a specific user
`Function SendEphemeralMessage(Val Token, Val Channel, Val Text = "", Val User = "", Val Blocks = "") Export`
2024-10-15 15:15:47 +03:00
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| Token | --token | String | ✔ | Bot token |
| Channel | --channel | String | ✔ | Channel ID |
| Text | --text | String | ✖ | Message text |
| User | --user | String | ✖ | User ID |
| Blocks | --blocks | Array of Structure | ✖ | JSON array of block descriptions |
2024-10-15 10:16:04 +03:00
Returns: Map Of KeyAndValue - serialized JSON response from Slack
<br/>
2024-10-15 21:15:56 +03:00
```bsl title="1C:Enterprise/OneScript code example"
2024-10-15 10:16:04 +03:00
Token = "xoxb-6965308400114-696804637...";
Channel = "C06UFNUTKUL";
User = "U06UABH3APP";
Image = "https://api.athenaeum.digital/test_data/picture.jpg";
Text = "Ephemeral message";
Block = OPI_Slack.GenerateImageBlock(Image, "Image");
Result = OPI_Slack.SendEphemeralMessage(Token, Channel, Text, User, Block);
```
```json title="Result"
{
"ok": true,
"message_ts": "1728454511.000300"
}
```