1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-07-03 00:58:12 +02:00
Files
OpenIntegrations/docs/en/md/Slack/Block-formation/Generate-image-block.md

46 lines
994 B
Markdown
Raw Normal View History

---
sidebar_position: 1
---
# Generate image block
Generates a block with an image to add to the message block array
2024-07-10 13:58:29 +03:00
`Function GenerateImageBlock(Val URL, Val AlternateText = "") Export`
| Parameter | CLI option | Type | Description |
|-|-|-|-|
| URL | --picture | String | Image URL |
| AlternateText | --alt | String | Alternate text of the image |
Returns: Map Of KeyAndValue - Image block
2024-07-10 14:05:58 +03:00
<br/>
2024-07-10 13:58:29 +03:00
```bsl title="Code example"
2024-10-05 11:21:35 +03:00
Image = "https://openyellow.neocities.org/test_data/picture.jpg";
Result = OPI_Slack.GenerateImageBlock(Image, "Image");
```
```sh title="CLI command example"
oint slack GenerateImageBlock --picture "https://github.com/Bayselonarrend/OpenIntegrations/raw/main/Media/logo.png?v1" --alt %alt%
```
```json title="Result"
2024-08-14 09:06:31 +03:00
{
2024-10-06 16:55:08 +03:00
"type": "image",
"image_url": "https://github.com/Bayselonarrend/OpenIntegrations/raw/main/service/test_data/picture.jpg",
"alt_text": "Image"
}
```