Spaces:
Sleeping
Sleeping
fix: set Telegram dmPolicy=open and configWrites=true for HF Spaces
Browse filesPersonal 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>
- 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().
|