fix: support AI commands in media captions
This commit is contained in:
@@ -59,10 +59,12 @@ class CommandDispatcher:
|
||||
account: "AccountState",
|
||||
) -> bool:
|
||||
text = getattr(message, "text", None)
|
||||
if not isinstance(text, str):
|
||||
caption = getattr(message, "caption", None)
|
||||
command_text = text if isinstance(text, str) else caption
|
||||
if not isinstance(command_text, str):
|
||||
return False
|
||||
|
||||
parsed = parse_command(text)
|
||||
parsed = parse_command(command_text)
|
||||
if parsed is None:
|
||||
return False
|
||||
|
||||
@@ -85,7 +87,7 @@ class CommandDispatcher:
|
||||
message=message,
|
||||
command=definition,
|
||||
prefix=parsed.prefix,
|
||||
raw_text=text,
|
||||
raw_text=command_text,
|
||||
args=parsed.args,
|
||||
alias=parsed.alias,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user