> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.omegatheme.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Telegram机器人创建与Chat ID获取指南

## 一、创建Telegram机器人获取Token
1. 打开Telegram应用搜索`@BotFather`
2. 点击"Start"开始对话
3. 选择菜单→`/newbot`或直接发送该指令
4. 按指引完成创建后，将收到包含以下关键信息的消息：

```
Done! Congratulations on your new bot. You will find it at t.me/new_bot.
You can now add a description.....

Use this token to access the HTTP API:
63xxxxxx71:AAFoxxxxn0hwA-2TVSxxxNf4c
Keep your token secure and store it safely, it can be used by anyone to control your bot.

For a description of the Bot API, see this page: https://core.telegram.org/bots/api
```
5. 妥善保存你的机器人Token：`63xxxxxx71:AAFoxxxxn0hwA-2TVSxxxNf4c`
## 二、获取私聊Chat ID
1. 搜索并打开你创建的机器人
2. 发送任意消息激活对话
3. 浏览器访问（注意Token前需加`bot`前缀）：
`https://api.telegram.org/bot63xxxxxx71:AAFoxxxxn0hwA-2TVSxxxNf4c/getUpdates`
4. 在返回的JSON数据中定位：

```
{
  "ok": true,
  "result": [
    {
      "update_id": 83xxxxx35,
      "message": {
        "message_id": 2643,
        "from": {...},
        "chat": {
          "id": 21xxxxx38,
          "first_name": "...",
          "last_name": "...",
          "username": "@username",
          "type": "private"
        },
        "date": 1703062972,
        "text": "/start"
      }
    }
  ]
}
```
5. 记录result.0.message.chat.id, Chat ID：`21xxxxx38`
6. 测试消息发送：
[https://api.telegram.org/bot63xxxxxx71:AAFoxxxxn0hwA-2TVSxxxNf4c/sendMessage?chat_id=21xxxxx38&text=test123](https://api.telegram.org/bot63xxxxxx71:AAFoxxxxn0hwA-2TVSxxxNf4c/sendMessage?chat_id=21xxxxx38&text=test123)`` 
## 三、获取频道Chat ID
1. 将机器人添加为频道管理员
2. 在频道发布任意消息
3. 访问相同API接口获取更新 [https://api.telegram.org/bot{our_bot_token}/getUpdates](https://api.telegram.org/bot%7Bour_bot_token%7D/getUpdates) 
4. 在返回数据中查找：

```
{
  "ok": true,
  "result": [
    {
      "update_id": 838xxxx36,
      "channel_post": {...},
        "chat": {
          "id": -1001xxxxxx062,
          "title": "....",
          "type": "channel"
        },
        "date": 1703065989,
        "text": "test"
      }
    }
  ]
}
```
5. 频道result.0.channel_post.chat.id， Chat ID示例：`-1001xxxxxx062`（注意包含 `-100`前缀）
6. 测试频道消息发送 https://api.telegram.org/bot63xxxxxx71:AAFoxxxxn0hwA-2TVSxxxNf4c/sendMessage?chat_id=-1001xxxxxx062&text=test123
7. 当我们正确设置了机器人令牌（bot token）和聊天 ID（chat ID）后，消息 “test123” 应该会发送到我们的 Telegram 频道中。**** 
## 四、获取群组Chat ID（推荐桌面端操作）
1. 通过Telegram桌面端添加机器人到群组
2. 在群组发送任意消息
3. 右键消息选择"Copy Message Link"，获得格式：
`https://t.me/c/194xxxx987/11/13`
4. 群组原始ID：`194xxxx987`
5. API使用需添加`-100`前缀：`-100194xxxx987`
6. 测试群组消息发送 [https://api.telegram.org/bot63xxxxxx71:AAFoxxxxn0hwA-2TVSxxxNf4c/sendMessage?chat_id=-100194xxxx987&text=test123](https://api.telegram.org/bot63xxxxxx71:AAFoxxxxn0hwA-2TVSxxxNf4c/sendMessage?chat_id=-100194xxxx987&text=test123) 
7. 当我们正确设置了机器人令牌（bot token）和聊天 ID（chat ID）后，消息 “test123” 应该会发送到我们的 Telegram 频道中。**** 
## 五、获取群组话题ID
1. 同上复制消息链接后，解析格式：
[https://t.me/c/194xxxx987/11/13](https://t.me/c/194xxxx987/11/13)
2. 示例中话题ID：`11`
3. 发送到指定话题需添加参数`&message_thread_id=11`： [https://api.telegram.org/bot783114779:AAEuRWDTFD2UQ7agBtFSuhJf2-NmvHN3OPc/sendMessage?chat_id=-100194xxxx987&message_thread_id=11&text=test123](https://api.telegram.org/bot783114779:AAEuRWDTFD2UQ7agBtFSuhJf2-NmvHN3OPc/sendMessage?chat_id=-100194xxxx987&message_thread_id=11&text=test123)
4. 当我们正确设置了机器人令牌（bot token）和聊天 ID（chat ID）后，消息 “test123” 应该会发送到我们的 Telegram 频道中。

| 设定配送预期，杜绝“我的订单在哪？”的询问
❌ 别让客户盲目等待。通过S: Estimated Delivery Date ETA功能，在商品页、购物车和结算页面展示精准物流时间轴。减少订单咨询量，提升购买信心，降低拒付风险。
👉👉👉[立即为您的店铺添加物流倒计时功能](https://apps.shopify.com/omega-estimated-shipping-date?utm_campaign=crs&utm_source=quote&utm_medium=docTelegram)

关注我们微信： 
![](https://storage.crisp.chat/users/helpdesk/website/-/8/3/8/3/8383e5404a31c000/qrcodeforghc0a8b123aa27258_17h2fp7.jpg)
