Add dual-prefix AI command

This commit is contained in:
Codex
2026-05-14 13:24:47 +02:00
parent 27b2760079
commit 2a731600e0
16 changed files with 607 additions and 16 deletions

View File

@@ -71,8 +71,18 @@ class CommandDispatcher:
await message.reply_text(f"Unknown command: {parsed.prefix}{parsed.alias}")
return True
if parsed.prefix != definition.prefix:
await message.reply_text(f"Use {definition.display_name} for this command")
actor_id = getattr(getattr(message, "from_user", None), "id", None)
owner_id = getattr(getattr(account, "me", None), "id", None)
is_owner = owner_id is not None and actor_id == owner_id
expected_prefix = definition.expected_prefix(is_owner)
if parsed.prefix != expected_prefix:
if definition.is_shared:
await message.reply_text(
f"Use {expected_prefix}{definition.name} for this account role"
)
else:
await message.reply_text(f"Use {definition.owner_prefix}{definition.name} for this command")
return True
ctx = CommandContext(