1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-03-29 21:57:16 +02:00
OpenIntegrations/docs/en/md/Slack/Block-formation/Generate-image-block.md
2024-08-13 15:52:26 +03:00

1.1 KiB

sidebar_position
1

Generate image block

Generates a block with an image to add to the message block array

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


  
  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
    
  oint slack GenerateImageBlock --picture "https://github.com/Bayselonarrend/OpenIntegrations/raw/main/Media/logo.png?v1" --alt %alt%

{
  "alt_text": "Yo",
  "image_url": "https://github.com/Bayselonarrend/OpenIntegrations/raw/main/Media/logo.png?v1",
  "type": "image"
  }