import telebot
from telebot import types # для указание типов
import config
bot = telebot.TeleBot('5968574660:AAFx_YTvm31qsHI9lLSst3OQJozm0KXQ3XU')
@bot.message_handler(commands=['photo'])
def start(message):
bot.send_message(message.chat.id, "отправьте фото")
@bot.message_handler(content_types=['photo'])
def photo(message):
bot.send_message(message.chat.id, "0")
fileID = message.photo[-1].file_id
file_info = bot.get_file(fileID)
downloaded_file = bot.download_file(file_info.file_path)
with open("E:/python/img0.jpg", 'wb') as new_file:
new_file.write(downloaded_file)
bot.send_message(message.chat.id, file_info)
@bot.message_handler(commands=['photo1'])
def start(message):
bot.send_message(message.chat.id, "отправьте фото")
@bot.message_handler(content_types=['photo'])
def photo2(message):
bot.send_message(message.chat.id, "1")
fileID = message.photo[-1].file_id
file_info = bot.get_file(fileID)
downloaded_file = bot.download_file(file_info.file_path)
with open("E:/python/img1.jpg", 'wb') as new_file:
new_file.write(downloaded_file)
bot.send_message(message.chat.id, file_info)
bot.polling(none_stop=True)