Initial commit

This commit is contained in:
2026-02-12 17:48:00 -06:00
parent 903df52206
commit 11c4ff5cb7
17 changed files with 1369 additions and 0 deletions

35
bot/command_registry.py Normal file
View File

@@ -0,0 +1,35 @@
"""
command_registry.py - Module registration for bot commands
Register domain-specific handlers for different interaction types.
"""
COMMAND_MODULES = {}
def register_module(interaction_type, handler):
"""
Register a handler for an interaction type.
Args:
interaction_type: String key (e.g., 'med', 'habit', 'task')
handler: Async function(message, session, parsed) -> None
Example:
async def handle_med(message, session, parsed):
action = parsed['action']
# ... handle medication logic ...
register_module('med', handle_med)
"""
COMMAND_MODULES[interaction_type] = handler
def get_handler(interaction_type):
"""Get the registered handler for an interaction type."""
return COMMAND_MODULES.get(interaction_type)
def list_registered():
"""List all registered interaction types."""
return list(COMMAND_MODULES.keys())