B
B
bongerka2020-05-25 21:52:17
Bots
bongerka, 2020-05-25 21:52:17

How to send media_group to telebot?

I'm already exhausted, I just can't figure out how to send media messages. For example, the bot receives 3 photos, how can I get their file_id. tried like this:

...
medgr = []
@bot.message_handler(content_types=['text', 'photo'])

def gg(message):
     if message.content_type == 'photo':
         medgr.append(InputMediaPhoto(message.photo[-1].file_id))
         bot.register_next_step_handler(bot.send_message(message.chat.id, "если все, отправьте любой текст"), gg) 
     else:
         bot.send_media_group(message.chat.id, medg)

it sends a mediagroup but 2 times in a row.
just give an example of correct usage please.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
macik, 2021-01-24
@macik

And how do you form medg?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question