Send media group
Sends a set of files to a chat or channel. Media types: audio, document, photo, video
Function SendMediaGroup(Val Token, Val ChatID, Val Text, Val FileMapping, Val Keyboard = "", Val Markup = "Markdown") Export
| Parameter | CLI option | Type | Required | Description | 
|---|---|---|---|---|
| Token | --token | String | ✔ | Bot token | 
| ChatID | --chat | String, Number | ✔ | Target chat ID or ChatID*TopicID | 
| Text | --text | String | ✔ | Message text | 
| FileMapping | --media | Map of KeyAndValue | ✔ | File collection: Key > File, Value > Media Type | 
| Keyboard | --keyboard | String | ✖ | Keyboard. See FormKeyboardFromButtonArray | 
| Markup | --parsemode | String | ✖ | Text processing type (HTML, Markdown, MarkdownV2) | 
Returns: Map Of KeyAndValue - serialized JSON response from Telegram
tip
Method at API documentation: sendMediaGroup
1C:Enterprise/OneScript code example
    Token  = "6129457865:AAFyzNYOAFbu...";
    ChatID = "461699897";
    Text   = "Строковое значение";
    Image  = "https://hut.openintegrations.dev/test_data/picture.jpg";
    Video  = "https://hut.openintegrations.dev/test_data/video.mp4";
    ImagePath = GetTempFileName("png");
    CopyFile(Image, ImagePath);
    VideoPath = GetTempFileName("mp4");
    CopyFile(Video, VideoPath);
    VideoDD = New BinaryData(VideoPath);
    MediaGroup = New Map;
    MediaGroup.Insert(ImagePath, "photo");
    MediaGroup.Insert(VideoDD  , "video");
    Result = OPI_Telegram.SendMediaGroup(Token, ChatID, Text, MediaGroup);
- Bash
 - CMD/Bat
 
    # JSON data can also be passed as a path to a .json file
    
    oint telegram SendMediaGroup \
     --token "***" \
     --chat "@testsichee" \
     --text "Строковое значение" \
     --media "{'https://hut.openintegrations.dev/test_data/document.docx':'document','C:\\Users\\bayse\\AppData\\Local\\Temp\\r3htsmor.1bm.docx':'document'}"
    :: JSON data can also be passed as a path to a .json file
    
    oint telegram SendMediaGroup ^
     --token "***" ^
     --chat "@testsichee" ^
     --text "Строковое значение" ^
     --media "{'https://hut.openintegrations.dev/test_data/document.docx':'document','C:\\Users\\bayse\\AppData\\Local\\Temp\\r3htsmor.1bm.docx':'document'}"
Result
{
 "ok": true,
 "result": [
  {
   "message_id": 17751,
   "from": {
    "id": 6129457865,
    "is_bot": true,
    "first_name": "Бот Виталий",
    "username": "sicheebot"
   },
   "chat": {
    "id": 461699897,
    "first_name": "Anton",
    "last_name": "Titovets",
    "username": "bayselonarrend",
    "type": "private"
   },
   "date": 1761909156,
   "media_group_id": "14095273254701970",
   "photo": [
    {
     "file_id": "AgACAgIAAxkDAAJDlGj8qc1B91BiqhJhGAJrM2u0yJmDAALw9zEborvpS7N-L5L1PXT9AQADAgADcwADNgQ",
     "file_unique_id": "AQAD8PcxG6K76Ut4",
     "file_size": 1568,
     "width": 90,
     "height": 67
    },
    {
     "file_id": "AgACAgIAAxkDAAJDlGj8qc1B91BiqhJhGAJrM2u0yJmDAALw9zEborvpS7N-L5L1PXT9AQADAgADbQADNgQ",
     "file_unique_id": "AQAD8PcxG6K76Uty",
     "file_size": 21633,
     "width": 320,
     "height": 240
    },
    {
     "file_id": "AgACAgIAAxkDAAJDlGj8qc1B91BiqhJhGAJrM2u0yJmDAALw9zEborvpS7N-L5L1PXT9AQADAgADeAADNgQ",
     "file_unique_id": "AQAD8PcxG6K76Ut9",
     "file_size": 99260,
     "width": 800,
     "height": 600
    },
    {
     "file_id": "AgACAgIAAxkDAAJDlGj8qc1B91BiqhJhGAJrM2u0yJmDAALw9zEborvpS7N-L5L1PXT9AQADAgADeQADNgQ",
     "file_unique_id": "AQAD8PcxG6K76Ut-",
     "file_size": 218651,
     "width": 1280,
     "height": 960
    },
    {
     "file_id": "AgACAgIAAxkDAAJDlGj8qc1B91BiqhJhGAJrM2u0yJmDAALw9zEborvpS7N-L5L1PXT9AQADAgADdwADNgQ",
     "file_unique_id": "AQAD8PcxG6K76Ut8",
     "file_size": 650214,
     "width": 2560,
     "height": 1920
    }
   ],
   "caption": "Строковое значение"
  },
  {
   "message_id": 17752,
   "from": {
    "id": 6129457865,
    "is_bot": true,
    "first_name": "Бот Виталий",
    "username": "sicheebot"
   },
   "chat": {
    "id": 461699897,
    "first_name": "Anton",
    "last_name": "Titovets",
    "username": "bayselonarrend",
    "type": "private"
   },
   "date": 1761909156,
   "media_group_id": "14095273254701970",
   "video": {
    "duration": 5,
    "width": 640,
    "height": 480,
    "file_name": "video1",
    "mime_type": "video/mp4",
    "thumbnail": {
     "file_id": "AAMCAgADFQdpBJmkAAG15bfPUDSIq_-FoH7-CGYAAr5_AALLyihIyDLwmh6J4TYBAAdtAAM2BA",
     "file_unique_id": "AQADvn8AAsvKKEhy",
     "file_size": 20106,
     "width": 320,
     "height": 240
    },
    "thumb": {
     "file_id": "AAMCAgADFQdpBJmkAAG15bfPUDSIq_-FoH7-CGYAAr5_AALLyihIyDLwmh6J4TYBAAdtAAM2BA",
     "file_unique_id": "AQADvn8AAsvKKEhy",
     "file_size": 20106,
     "width": 320,
     "height": 240
    },
    "file_id": "BAACAgIAAxUHaQSZpAABteW3z1A0iKv_haB-_ghmAAK-fwACy8ooSMgy8JoeieE2NgQ",
    "file_unique_id": "AgADvn8AAsvKKEg",
    "file_size": 1137878
   }
  }
 ]
}