elif call.data == 'verify_name':
user_id=call.message.chat.id
query=(f"""
SELECT name
FROM user
WHERE id=%(id)s """%{"id":user_id})
c.execute(query)
name=c.fetchone()
delimiter = ','
single_str = delimiter.join(name)
print(format(single_str))
confirm_name=('Имя '+ format(single_str) +' записано')
sql.commit()
sql.close
bot.send_message(call.message.chat.id, confirm_name, parse_mode='html')
@bot.message_handler(content_types=['text'])
def history_now(message):
if message.chat.type == 'private':
<b> user_id=message.chat.id</b>
c.execute(f"SELECT race FROM user WHERE <b>id={user_id}</b>",)
data=c.fetchone()
if data is not None:
name=message.text
c.execute(f"UPDATE user SET name =? WHERE id=?",(name, user_id) )
sql.commit()
sql.close
confirm_name=(f'Имя {name} записано')
bot.send_message(message.chat.id, confirm_name, parse_mode='html')