first commit
This commit is contained in:
30
bot/commands/routines.py
Normal file
30
bot/commands/routines.py
Normal file
@@ -0,0 +1,30 @@
|
||||
"""
|
||||
Routines command handler - bot-side hooks for routine management
|
||||
"""
|
||||
|
||||
from bot.command_registry import register_module
|
||||
import ai.parser as ai_parser
|
||||
|
||||
|
||||
async def handle_routine(message, session, parsed):
|
||||
action = parsed.get("action", "unknown")
|
||||
token = session["token"]
|
||||
user_uuid = session["user_uuid"]
|
||||
|
||||
# TODO: wire up API calls per action
|
||||
pass
|
||||
|
||||
|
||||
def validate_routine_json(data):
|
||||
errors = []
|
||||
if not isinstance(data, dict):
|
||||
return ["Response must be a JSON object"]
|
||||
if "error" in data:
|
||||
return []
|
||||
if "action" not in data:
|
||||
errors.append("Missing required field: action")
|
||||
return errors
|
||||
|
||||
|
||||
register_module("routine", handle_routine)
|
||||
ai_parser.register_validator("routine", validate_routine_json)
|
||||
Reference in New Issue
Block a user