GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Telegram Bot Manager
  • 设置 Webhook
  • 检查 Webhook(getWebhookInfo)
  • 删除 Webhook
  • 机器人命令编辑器
  • English
  • Русский
  • Español
  • Português

This view

  • Original page
  • New address

GeezerVison is showing f1devbin.github.io — Telegram 机器人命令编辑器——在线使用 setMyCommands

在线编辑 Telegram 机器人命令

机器人命令显示在菜单中,以及用户输入“/”时的提示里。你可以为私聊、群组、管理员和不同语言设置不同的列表。

几次点击即可完成——无需写代码、无需服务器,直接在浏览器中操作。

打开命令编辑器

格式

每行一个命令,名称和描述之间用短横线分隔:

start - Start the bot
help - Show help
settings - Open settings
tip - A hint only you can see [ephemeral]
  • 每个列表最多 100 个命令。
  • 名称:1–32 个字符,只能是小写英文字母、数字和下划线。开头的“/”会被自动去掉。
  • 描述:1–256 个字符。
  • [ephemeral] 表示该命令的回复仅发送者可见(Bot API 10.2)。

范围(scope)

Scope谁能看到列表
default没有更具体的范围时,所有人。
all_private_chats所有私聊。
all_group_chats所有群组和超级群组。
all_chat_administrators所有群组的管理员。
chat指定的一个聊天(chat_id)。
chat_administrators指定聊天的管理员。
chat_member指定聊天中的一个成员(chat_id + user_id)。

每个范围还可以按 language_code(两个字母的 ISO 639-1)设置不同列表。Telegram 会先选最具体的范围,再选用户语言,最后选不带语言的列表。

使用 curl

curl -X POST "https://api.telegram.org/bot$BOT_TOKEN/setMyCommands" \
  --form-string 'commands=[{"command":"start","description":"Start the bot"},{"command":"help","description":"Show help"}]' \
  --form-string 'scope={"type":"all_private_chats"}' \
  --form-string "language_code=en"

删除列表:

curl -X POST "https://api.telegram.org/bot$BOT_TOKEN/deleteMyCommands" \
  --form-string 'scope={"type":"all_group_chats"}'

小贴士

  • 描述尽量简短——在较窄的菜单中会被截断。
  • 用户重新打开聊天后才会看到更改,客户端会缓存命令列表。
  • 在“菜单按钮”选项卡中,可以让输入框旁的按钮显示命令列表或小程序。

几次点击即可完成——无需写代码、无需服务器,直接在浏览器中操作。

打开命令编辑器

更多教程

设置 Webhook几次点击即可设置 Telegram 机器人 Webhook:HTTPS URL、Secret Token、allowed_updates、max_connections 和自签名证书。附 curl 示例。 检查 Webhook(getWebhookInfo)在线检查 Telegram 机器人 Webhook:URL、待处理更新、最近错误及其含义。修复 SSL、DNS、超时和 4xx/5xx Webhook 错误。 删除 Webhook在线删除 Telegram 机器人 Webhook(deleteWebhook),丢弃待处理更新,解决“409 Conflict: can't use getUpdates method while webhook is active”。
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.