на каком месте юзер по баллам?
SELECT username, row_number() over(ORDER BY balli DESC) rownum FROM users ORDER BY balli DESC LIMIT 10
... ORDER BY balli DESC, username
@bot.message_handler(content_types=['text'])
def get_text_messages(message):
if message.text.lower() == '/reg' or message.text.lower() == '/help':
bot.send_message(message.chat.id, 'success')
text = message.text
us_id = message.from_user.id
cursor.execute('INSERT INTO test(us_id, text) VALUES(?, ?) ON CONFLICT(us_id) DO UPDATE SET text = excluded.text', (us_id, text))
conn.commit()
regex_mail = r'([\w-]+@(?:[\w-]+\.)+[\w-]+)'
regex_pass = r'([A-Za-z\d_@$!%*?&]{6,})'
combined = regex_mail + '.+?' + regex_pass
m = re.search(combined, s)
print(m)
print(m[1])
print(m[2])
print(result)
{'money': 0}
int(result.get("money",0))
result["money"]
...
result = self.cursor.fetchone()
if result is not None:
print(result)
return result["money"]
else:
#result = result[0] # это вообще зачем было?
print(result)
print("!")