tao-shen Claude Opus 4.6 commited on
Commit
27fc3a4
Β·
1 Parent(s): d88aa6c

fix: set Telegram dmPolicy=open and configWrites=true for HF Spaces

Browse files

Personal bot β€” no need for strict pairing. Fixes "not authorized" error
when user sends commands after pairing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Files changed (1) hide show
  1. scripts/sync_hf.py +8 -0
scripts/sync_hf.py CHANGED
@@ -481,6 +481,14 @@ class OpenClawFullSync:
481
  elif isinstance(data["plugins"]["entries"]["telegram"], dict):
482
  data["plugins"]["entries"]["telegram"]["enabled"] = True
483
 
 
 
 
 
 
 
 
 
484
  # ── Telegram API base auto-probe ──────────────────────────────
485
  # Probe is done in run_openclaw() β€” sets TELEGRAM_API_ROOT env var
486
  # for the telegram-proxy.cjs preload script to intercept fetch().
 
481
  elif isinstance(data["plugins"]["entries"]["telegram"], dict):
482
  data["plugins"]["entries"]["telegram"]["enabled"] = True
483
 
484
+ # ── Telegram channel defaults (open DM policy for HF Spaces) ──
485
+ # Personal bot on HF Spaces β€” no need for strict pairing.
486
+ tg_ch = data.setdefault("channels", {}).setdefault("telegram", {})
487
+ if tg_ch.get("dmPolicy") in ("pairing", None):
488
+ tg_ch["dmPolicy"] = "open"
489
+ print("[SYNC] Set channels.telegram.dmPolicy = open")
490
+ tg_ch["configWrites"] = True
491
+
492
  # ── Telegram API base auto-probe ──────────────────────────────
493
  # Probe is done in run_openclaw() β€” sets TELEGRAM_API_ROOT env var
494
  # for the telegram-proxy.cjs preload script to intercept fetch().