Answer the question
In order to leave comments, you need to log in
How to fix "'tuple' object has no attribute 'chat'"?
def incodetype1(message):
code = message.text
conn = sqlite3.connect("users.db", check_same_thread=False)
cursor = conn.cursor()
cursor.execute('SELECT message FROM bdmes WHERE keyaccess = ?', [code])
for message in cursor.fetchall():
bot.send_message(message.chat.id, 'Сообщение: ' + str(message))
bot.send_message(message.chat.id, 'Сообщение: ' + str(message))
AttributeError: 'tuple' object has no attribute 'chat'
Answer the question
In order to leave comments, you need to log in
Do not overlap the function argument with the loop variable.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question