From 60f86b52c8dc1750b1386968ace0609deff6dd26 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 26 Oct 2024 14:33:26 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BC=D0=B5=D0=BB=D0=BA=D0=B8=D1=85?= =?UTF-8?q?=20=D0=B1=D0=B0=D0=B3=D0=BE=D0=B2=20=D0=B8=20=D0=BD=D0=B5=D0=B4?= =?UTF-8?q?=D0=BE=D1=87=D1=91=D1=82=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api.py | 14 ++++++++++---- tg.py | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/api.py b/api.py index 1475a82..8fa8145 100644 --- a/api.py +++ b/api.py @@ -219,10 +219,16 @@ def update_mine(it: Update_mine): token, id, mine = it.token, it.id, it.mine if token_check(token): db = read() - cur_mine = db['id'][id]['mine'] - del db['mine'][cur_mine] - db['id'][id]['mine'] = mine - db['mine'][mine] = id + try: + cur_mine = db['id'][id]['mine'] + del db['mine'][cur_mine] + except: + pass + if mine == 'None': + db['id'][id]['mine'] = None + else: + db['id'][id]['mine'] = mine + db['mine'][mine] = id write(db) return 'OK' else: diff --git a/tg.py b/tg.py index 56e0ed2..23a5711 100644 --- a/tg.py +++ b/tg.py @@ -110,7 +110,7 @@ def login(message): else: bot.reply_to(message, 'Пароль не совпадает') else: - bot.reply_to(message, '/login пароль') + bot.reply_to(message, '/login ник пароль') @bot.message_handler(commands=['unreg']) def unreg(message):