2 Telegram Bot
luolongfei edited this page 2022-09-20 10:26:32 +08:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

1、将.env文件中的TELEGRAM_BOT_ENABLE的值改为1,即可启用 Telegram Bot 送信功能

2、在 Telegram 客户端中搜索@userinfobot,并打开聊天窗口

3、发送/start@userinfobot即可以获取自己的 Id.env文件中的TELEGRAM_CHAT_ID的值改为前面获取到的 Id

4、在 Telegram 客户端中搜索@BotFather,并打开聊天窗口

5、发送/newbot@BotFather,然后根据提示创建,创建完成后根据图示操作获取token

tg_bot_create.png

6、将.env文件中的TELEGRAM_BOT_TOKEN的值改为上一步获取的token

7、在 Telegram 客户端中搜索你创建的机器人的账户,上面示例中机器人账户为@fat_tiger_bot,请替换为你自己的。找到机器人账户并打开聊天对话框,点击聊天输入框中的 /start 按钮或者直接给机器人发送 /start,以启用机器人

8、可选为 Telegram Bot 设置代理。针对国内网络环境,可将.env文件中的TELEGRAM_PROXY的值改为代理值,具体参考.env文件中的注释

更多与 Telegram Bot 相关内容请参考:官方文档

Telegram bot 送信部分完。