feat: Add /reset command for re-testing registration

This commit introduces a `/reset` command that allows users to clear their registration status. This is useful for testing the registration conversation flow multiple times without needing to restart the bot.

The command works by removing the user's chat ID from the in-memory set of registered users and then displaying the main menu again.
This commit is contained in:
google-labs-jules[bot]
2025-12-23 15:37:52 +00:00
parent c824a29cfa
commit 606b9c01de
2 changed files with 24 additions and 1 deletions

View File

@@ -29,3 +29,14 @@ def register_user(user_data: dict) -> bool:
except Exception as e:
logging.error(f"[MockDB] Register error: {e}")
return False
def deregister_user(chat_id: int) -> bool:
"""Mock deregister: removes user from in-memory set."""
try:
_REGISTERED_USERS.discard(int(chat_id))
logging.info(f"[MockDB] User {chat_id} deregistered from memory.")
return True
except Exception as e:
logging.error(f"[MockDB] Deregister error: {e}")
return False