Add dual-prefix AI command
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user