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):