Исправление хранения токенов: токены теперь в user_gamers, а не в gamers
- Добавлено поле token в таблицу user_gamers - Токены теперь привязываются к паре пользователь-игрок, а не глобально - Обновлены методы работы с токенами - Теперь каждый пользователь может иметь свой токен для одного игрока
This commit is contained in:
parent
a08fc8c962
commit
2c87dc60f7
2 changed files with 35 additions and 24 deletions
|
|
@ -96,10 +96,10 @@ class LichessBot:
|
|||
if profile:
|
||||
username = profile.get('username')
|
||||
if username:
|
||||
# Add gamer to database
|
||||
gamer_id = self.db.add_gamer(username, token)
|
||||
# Link user to gamer
|
||||
self.db.add_user_gamer(user_id, gamer_id)
|
||||
# Add gamer to database (without token)
|
||||
gamer_id = self.db.add_gamer(username)
|
||||
# Link user to gamer WITH token
|
||||
self.db.add_user_gamer(user_id, gamer_id, token)
|
||||
|
||||
# If this is the first gamer for this user, make it active
|
||||
user_gamers = self.db.get_user_gamers(user_id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue