@dmitriy8720

Как опубликовать 10 фото, от имени бота?

Подскажите, как опубликовать до 10 фото, от имени бота, в группе? добавляется только 1, хотя добавляю 5,8,10.

import telebot
import time
from telebot import types

API_TOKEN = 'moi_token'

bot = telebot.TeleBot(API_TOKEN)

@bot.message_handler(commands=['start'])
def start(message):
    msg = bot.send_message(message.chat.id, 'введите текст')
    bot.register_next_step_handler(msg, create_request)

def create_request(message):
    bot.send_message(message.chat.id, 'ваш текст опубликован')
    bot.send_message(-idgruppy_cyfry, '{0}\n{1}\n{2}\n{3}'.format(message.text, message.from_user.first_name, message.from_user.username, message.chat.id))
    bot.send_photo(-idgruppy_cyfry, message.photo[-1].file_id)

bot.infinity_polling()
  • Вопрос задан
  • 293 просмотра
Пригласить эксперта
Ответы на вопрос 1
donko1
@donko1
Изучаю python
В начале импортировать InputMediaPhotofrom telebot.types import InputMediaPhoto
Примерно так
with open('files/1.jpg', 'rb') as f1, open('files/2.jpg', 'rb') as f2:
            bot.send_media_group(chat.id, [InputMediaPhoto(f1),InputMediaPhoto(f2)])
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы