Routing for media
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Ekaropolus 2025-09-17 18:39:47 -06:00
parent b44db9d71b
commit 3fa732efbc

View File

@ -116,6 +116,15 @@ def build_req_v1(update: Dict[str, Any], bot_name: str) -> Dict[str, Any]:
elif cbq and isinstance(cbq.get("data"), str):
raw_cmd = None # callbacks carry 'data' instead
# --- NEW: pseudo-commands for media so we can route from Admin ---
if not raw_cmd:
if media and isinstance(media, dict):
mtype = (media.get("type") or "").lower()
if mtype in {"voice", "audio", "video", "photo", "document", "animation", "video_note"}:
raw_cmd = f"__{mtype}__"
elif location:
raw_cmd = "__location__"
env = {
"schema_version": schema_version,
"bot": {"username": bot_name},