elif message.text == ' Информация о профиле':
db = sqlite3.connect('bot.db')
sql = db.cursor()
sql.execute("""CREATE TABLE IF NOT EXISTS users (
login TEXT,
password TEXT,
tiktok TEXT,
cash INT
)""")
db.commit()
tiktok_name = "ihfjrwjwrjwrjewfjwefjwe"
bot.send_message(message.chat.id, " Имя: {0.first_name}". format ( message. from_user , bot. get_me ( ) ))
bot.send_message(message.chat.id, f" Ваш логин: {message.from_user.id}")
sql.execute(f'UPDATE users SET tiktok = ? WHERE login = ?', (tiktok_name, message.from_user.id))
db.commit()
tik = sql.execute(f"SELECT tiktok from users WHERE login = '{message.from_user.id}'")
bot.send_message(message.chat.id, f"ваш тикток: {tik}")
balance = sql.execute(f"SELECT cash from users WHERE login = '{message.from_user.id}'").fetchone()[0]
bot.send_message(message.chat.id, f" Ваш баланс: {balance} RUB ")\
<sqlite3.Cursor ...
а не просто пустую строку....
user_info = sql.execute(f"SELECT tiktok, cash from users WHERE login = '{message.from_user.id}'").fetchone()
if user_info:
tik, balance = user_info
bot.send_message(message.chat.id, f"ваш тикток: {tik}")
bot.send_message(message.chat.id, f" Ваш баланс: {balance} RUB ")