jkes6203 commited on
Commit
176c3ba
·
1 Parent(s): 83361c1

Re-enable Telegram bot menu by default

Browse files
Files changed (3) hide show
  1. README.md +2 -1
  2. TELEGRAM_SUPABASE_STATUS.md +8 -0
  3. setup-hf-config.mjs +5 -3
README.md CHANGED
@@ -178,7 +178,8 @@ The startup script `setup-hf-config.mjs` reads the following from **Secrets** or
178
  | `OPENCLAW_TELEGRAM_DISABLE_AUTO_SELECT_FAMILY` | `channels.telegram.network.autoSelectFamily=false` | Existing OpenClaw workaround for Telegram network failures on some hosts |
179
  | `OPENCLAW_TELEGRAM_DNS_RESULT_ORDER` | `channels.telegram.network.dnsResultOrder` | Existing OpenClaw Telegram network workaround; default `ipv4first` |
180
  | `OPENCLAW_TELEGRAM_PROXY` | `channels.telegram.proxy` | Optional SOCKS/HTTP proxy URL for Telegram Bot API calls |
181
- | Telegram command menu | `channels.telegram.commands.native = off` | This HF wrapper disables Telegram command-menu registration to reduce noisy `setMyCommands` retries on constrained hosts |
 
182
  | `OPENCLAW_STARTUP_NOTIFY` | startup notify helper | `1` / `0`; send a best-effort Telegram startup notification |
183
  | `OPENCLAW_STARTUP_NOTIFY_TELEGRAM_TO` | startup notify helper | Optional explicit Telegram chat id; defaults to first `OPENCLAW_TELEGRAM_ALLOW_FROM` entry |
184
  | `OPENCLAW_TELEGRAM_API_HOST` | startup notify helper | Optional alternate Telegram Bot API host; default `api.telegram.org` |
 
178
  | `OPENCLAW_TELEGRAM_DISABLE_AUTO_SELECT_FAMILY` | `channels.telegram.network.autoSelectFamily=false` | Existing OpenClaw workaround for Telegram network failures on some hosts |
179
  | `OPENCLAW_TELEGRAM_DNS_RESULT_ORDER` | `channels.telegram.network.dnsResultOrder` | Existing OpenClaw Telegram network workaround; default `ipv4first` |
180
  | `OPENCLAW_TELEGRAM_PROXY` | `channels.telegram.proxy` | Optional SOCKS/HTTP proxy URL for Telegram Bot API calls |
181
+ | `OPENCLAW_TELEGRAM_NATIVE_COMMANDS` | `channels.telegram.commands.native` | `1` / `0`; default is enabled so the bot menu can appear |
182
+ | `OPENCLAW_TELEGRAM_NATIVE_SKILLS` | `channels.telegram.commands.nativeSkills` | `1` / `0`; defaults to the same value as native commands |
183
  | `OPENCLAW_STARTUP_NOTIFY` | startup notify helper | `1` / `0`; send a best-effort Telegram startup notification |
184
  | `OPENCLAW_STARTUP_NOTIFY_TELEGRAM_TO` | startup notify helper | Optional explicit Telegram chat id; defaults to first `OPENCLAW_TELEGRAM_ALLOW_FROM` entry |
185
  | `OPENCLAW_TELEGRAM_API_HOST` | startup notify helper | Optional alternate Telegram Bot API host; default `api.telegram.org` |
TELEGRAM_SUPABASE_STATUS.md CHANGED
@@ -25,6 +25,14 @@
25
  - `OPENCLAW_TELEGRAM_INIT_NOTIFY_CHAT_IDS=1083910061`
26
  - `OPENCLAW_STARTUP_NOTIFY_TELEGRAM_TO=1083910061`
27
 
 
 
 
 
 
 
 
 
28
  ### How Telegram is currently made to work on HF Space
29
 
30
  1. The container resolves `api.telegram.org` during startup.
 
25
  - `OPENCLAW_TELEGRAM_INIT_NOTIFY_CHAT_IDS=1083910061`
26
  - `OPENCLAW_STARTUP_NOTIFY_TELEGRAM_TO=1083910061`
27
 
28
+ ### Bot menu
29
+
30
+ - Earlier versions of this HF wrapper forced `channels.telegram.commands.native = false`, which hid the Telegram bot menu.
31
+ - The current fix changes that behavior so native Telegram commands are enabled by default again.
32
+ - Optional overrides:
33
+ - `OPENCLAW_TELEGRAM_NATIVE_COMMANDS=1|0`
34
+ - `OPENCLAW_TELEGRAM_NATIVE_SKILLS=1|0`
35
+
36
  ### How Telegram is currently made to work on HF Space
37
 
38
  1. The container resolves `api.telegram.org` during startup.
setup-hf-config.mjs CHANGED
@@ -360,6 +360,8 @@ const telegramInitNotifyChatIds = dedupe([
360
  ...parseCsv(process.env.OPENCLAW_STARTUP_NOTIFY_TELEGRAM_TO?.trim()),
361
  ...telegramAllowFrom,
362
  ]);
 
 
363
  const telegramDisableAutoSelectFamily = parseBoolean(process.env.OPENCLAW_TELEGRAM_DISABLE_AUTO_SELECT_FAMILY);
364
  const telegramEnableAutoSelectFamily = parseBoolean(process.env.OPENCLAW_TELEGRAM_ENABLE_AUTO_SELECT_FAMILY);
365
  const telegramDnsResultOrder = process.env.OPENCLAW_TELEGRAM_DNS_RESULT_ORDER?.trim();
@@ -466,9 +468,9 @@ if (
466
  config.channels.telegram.groups["*"].requireMention = telegramRequireMention;
467
  }
468
  if (!config.channels.telegram.commands) config.channels.telegram.commands = {};
469
- // Reduce startup noise on constrained hosts: disable Telegram command-menu registration.
470
- config.channels.telegram.commands.native = false;
471
- config.channels.telegram.commands.nativeSkills = false;
472
  if (!config.channels.telegram.network) config.channels.telegram.network = {};
473
  // HF Spaces often behave better with IPv4-only family selection for Telegram Bot API.
474
  if (telegramDisableAutoSelectFamily === true) {
 
360
  ...parseCsv(process.env.OPENCLAW_STARTUP_NOTIFY_TELEGRAM_TO?.trim()),
361
  ...telegramAllowFrom,
362
  ]);
363
+ const telegramNativeCommands = parseBoolean(process.env.OPENCLAW_TELEGRAM_NATIVE_COMMANDS);
364
+ const telegramNativeSkills = parseBoolean(process.env.OPENCLAW_TELEGRAM_NATIVE_SKILLS);
365
  const telegramDisableAutoSelectFamily = parseBoolean(process.env.OPENCLAW_TELEGRAM_DISABLE_AUTO_SELECT_FAMILY);
366
  const telegramEnableAutoSelectFamily = parseBoolean(process.env.OPENCLAW_TELEGRAM_ENABLE_AUTO_SELECT_FAMILY);
367
  const telegramDnsResultOrder = process.env.OPENCLAW_TELEGRAM_DNS_RESULT_ORDER?.trim();
 
468
  config.channels.telegram.groups["*"].requireMention = telegramRequireMention;
469
  }
470
  if (!config.channels.telegram.commands) config.channels.telegram.commands = {};
471
+ config.channels.telegram.commands.native = telegramNativeCommands ?? true;
472
+ config.channels.telegram.commands.nativeSkills =
473
+ telegramNativeSkills ?? config.channels.telegram.commands.native;
474
  if (!config.channels.telegram.network) config.channels.telegram.network = {};
475
  // HF Spaces often behave better with IPv4-only family selection for Telegram Bot API.
476
  if (telegramDisableAutoSelectFamily === true) {