Answer the question
In order to leave comments, you need to log in
How to determine that the bot was sent a file?
you need to check what was sent to the bot. If the photo is to do one thing, if the file (document) is another. Used this design:
if m.text:
msg = bot.send_message(ind, 'Пришлите фото')
bot.register_next_step_handler(msg, regcheckphoto)
elif m.file[-1].file_id:
msg = bot.send_message(ind, 'Пришлите фото')
bot.register_next_step_handler(msg, regcheckphoto)
else:
checkphoto = m.photo[-1].file_id
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question