@bot.message_handler(commands=['start'])
def work_message(message):
b = [{"type": "photo","media": 'AgACAgIAAxkBAAIE2GGGaCL7KwavQD-0LF1pJ8YVwQ-cAALhtjEbiKAxSMVsHtMbW3vFAQADAgADcwADIgQ'},{"type": "photo","media": 'AgACAgIAAxkBAAIE2WGGaCZZ9a-6aVoXW57pY3w_7YTpAALftjEbiKAxSCjk7HwjVLt3AQADAgADeAADIgQ'}]
bj = json.dumps(b, separators=(',', ':'))
bot.send_media_group(message.chat.id, b)
bot.polling()
@bot.message_handler(content_types=['photo'])
def photo_message(message):
global a
a.append(message.json['photo'][0]['file_id'])
@bot.message_handler(content_types=['text'])
def work_message(message):
global a
print(a)
if message.text == 'Фото':
bot.send_media_group(message.from_user.id, a)