2024-06-05 12:19:46 +02:00
|
|
|
---
|
|
|
|
sidebar_position: 1
|
|
|
|
---
|
|
|
|
|
|
|
|
# Generate image block
|
|
|
|
Generates a block with an image to add to the message block array
|
|
|
|
|
|
|
|
|
2024-07-10 10:59:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
<br/>
|
|
|
|
|
|
|
|
|
2024-06-05 12:19:46 +02:00
|
|
|
*Function GenerateImageBlock(Val URL, Val AlternateText = "") Export*
|
|
|
|
|
|
|
|
| Parameter | CLI option | Type | Destination |
|
|
|
|
|-|-|-|-|
|
|
|
|
| URL | --picture | String | Image URL |
|
|
|
|
| AlternateText | --alt | String | Alternate text of the image |
|
|
|
|
|
|
|
|
|
2024-06-06 14:33:52 +02:00
|
|
|
Returns: Map Of KeyAndValue - Image block
|
2024-06-05 12:19:46 +02:00
|
|
|
|
2024-07-10 10:59:55 +02:00
|
|
|
|
2024-06-05 12:19:46 +02:00
|
|
|
```bsl title="Code example"
|
|
|
|
|
|
|
|
Text = "Alpaca picture";
|
|
|
|
URL = "https://github.com/Bayselonarrend/OpenIntegrations/raw/main/Media/logo.png?v1";
|
|
|
|
|
|
|
|
Response = OPI_Slack.GenerateImageBlock(URL, Text); //Map
|
|
|
|
Response = OPI_Tools.JSONString(Response); //JSON string
|
|
|
|
|
|
|
|
```
|
2024-07-10 10:59:55 +02:00
|
|
|
|
|
|
|
|
2024-06-05 12:19:46 +02:00
|
|
|
|
|
|
|
```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-07-10 10:59:55 +02:00
|
|
|
{
|
2024-06-05 12:19:46 +02:00
|
|
|
"alt_text": "Yo",
|
|
|
|
"image_url": "https://github.com/Bayselonarrend/OpenIntegrations/raw/main/Media/logo.png?v1",
|
|
|
|
"type": "image"
|
|
|
|
}
|
|
|
|
```
|