@bot.message_handler(commands=['start'])
def start_message(message):
try:
sql = "INSERT INTO users (first_name, last_name, username, user_id) VALUES (%s, %s, %s, %s)"
val = (message.chat.first_name, message.chat.last_name, message.chat.username,
message.chat.id)
cursor.execute(sql, val)
db.commit()
bot.send_message(
message.chat.id, 'Привет', reply_markup=markup)
except Exception as e:
sql = "UPDATE users SET first_name = WHERE id = "
frs = (message.chat.first_name)
cursor.execute(sql, frs)
db.commit()
bot.send_message(
message.chat.id, 'Привет', reply_markup=markup)