Answer the question
In order to leave comments, you need to log in
How to pull an image from a SQLite database and give it to the user?
I welcome everyone!
Tell me, is there any possibility in Telegram bot to do this:
1) The user enters a number corresponding to the number in the table
2) An image corresponding to the entered number is obtained from the SQLite database table.
3) This image or several images are sent to the user.
Tried like this, but it must be wrong)
def two_step(message):
try:
line_number = message.text
photog = cursor.execute('SELECT photo FROM TableTable WHERE line_number=?', (line_number, )).fetchone()
bot.send_photo(message.chat.id, photo = photog)
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