T
T
Tabasov2018-11-27 20:34:16
API
Tabasov, 2018-11-27 20:34:16

Telegram API, method - sendMediaGroup?

Who in the subject please clarify to me the use of this method.
Can I submit Albums consisting of strictly one media type, or is it acceptable to use "mixed" data?

bot.sendMediaGroup(ID, [
  {
    type: 'photo',
    media: 'https://photo_path.jpg'
  },
  {
    type: 'photo',
    media: 'https://photo_path.jpg'
  },
  {
    type: 'video',
    media: 'https://video_path.mp4'
  },
  {
    type: 'video',
    media: 'https://video_path.mp4'
  }
]);

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Kuvardin, 2018-12-03
@Kuvardin

https://core.telegram.org/bots/api/#sendmediagroup
The value of the "media" field must be an Array of InputMediaPhoto and InputMediaVideo (an array of InputMediaPhoto and/or InputMediaVideo). Moreover, photos and videos can be mixed (from 2 to 10 pieces).

A
Alexey, 2021-11-03
@olololollloo

for 2021
https://core.telegram.org/bots/api/#sendmediagroup
"Documents and audio files can only be grouped into an album with messages of the same type"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question