Telegram Bot创建

written in 2018 — details may be outdated

Contents
  1. Telegram Bot 创建
  2. 获取自己的Chat Id
  3. bot 能干什么呢?

Telegram Bot 创建#

在telegram中找到@Botfather
(他是所有bot的爸爸所以叫botfather)
所有的bot都要通过他产生

给他发 /newbot就可以开始创建一个bot

跟随指引输入bot名字和用户名就成功了

(image unavailable: Screenshot_20180205-224610__01.jpg)

随后你会获得一个webapi的token

拿着这个token就可以开始玩耍了

获取自己的Chat Id#

很多情况下若是给自己使用的bot都会需要自己的chat id
这里提供一个简单的获取办法
@userinfobot --- 获取chat id 的bot

发任意内容即可获得自己的chat id

bot 能干什么呢?#

可以用来提醒

(image unavailable: Screenshot_20180205-225452__01.jpg)

还有很多功能
比如teleshell,可以通过telegram远程在服务器上执行shell命令。

Keyboard shortcuts

Everywhere
0 1 2 3 4Go to blog, categories, projects, friends, about
/Open search
?Show or hide this help
EscClose help or menu, clear selection
g g / GTop / bottom of page
Lists
j / k ↓ / ↑Move highlight down / up
Enter / oOpen the highlighted item
{ / }Previous / next group
Post
j / kScroll down / up
d / uScroll half a page down / up
] / [Next / previous heading
n / pOlder / newer post
lSwitch to the translation
b / BackspaceBack to the list, or home
yCopy the post URL

Search posts