电报(teegram)创建机器人教程
电报(teegram),拥有机器人功能,类似于微信公众号。不过,具有创建简单,免费,无需认证等特点。
首先,我们需要先与“https://t.me/BotFather” 对话。如图:
/help
I can help you create and manage Telegram bots. If you're new to the Bot API, please see the manual (https://core.telegram.org/bots).
You can control me by sending these commands:
/newbot - create a new bot
/mybots - edit your bots [beta]
Edit Bots
/setname - change a bot's name
/setdescription - change bot description
/setabouttext - change bot about info
/setuserpic - change bot profile photo
/setcommands - change the list of commands
/deletebot - delete a bot
Bot Settings
/token - generate authorization token
/revoke - revoke bot access token
/setinline - toggle inline mode (https://core.telegram.org/bots/inline)
/setinlinegeo - toggle inline location requests (https://core.telegram.org/bots/inline#location-based-results)
/setinlinefeedback - change inline feedback (https://core.telegram.org/bots/inline#collecting-feedback) settings
/setjoingroups - can your bot be added to groups?
/setprivacy - toggle privacy mode (https://core.telegram.org/bots#privacy-mode) in groups
Games
/mygames - edit your games (https://core.telegram.org/bots/games) [beta]
/newgame - create a new game (https://core.telegram.org/bots/games)
/listgames - get a list of your games
/editgame - edit a game
/deletegame - delete an existing game
第一步:输入创建机器人命令: /newbot
Alright, a new bot. How are we going to call it? Please choose a name for your bot.
第二步:输入机器人名字:xiao6-bot
Good. Now let's choose a username for your bot. It must end in `bot`. Like this, for example: TetrisBot or tetris_bot.
第三步:输入机器人用户名:xiao6Bot
注意:用户名里面,必须要以“Bot”或者"_bot"结尾。否则会提示格式不正确的。
Done! Congratulations on your new bot. You will find it at t.me/xiao6Bot. You can now add a description, about section and profile picture for your bot, see /help for a list of commands. By the way, when you've finished creating your cool bot, ping our Bot Support if you want a better username for it. Just make sure the bot is fully operational before you do this.
Use this token to access the HTTP API:
0000000000:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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
出现第三步中的信息,则表示机器人已经创建成功了!同时,第三步的回复信息中,也会有刚创建的机器人的token秘钥信息,这个必须要保存起来哦。
创建成功之后,我们就可以利用telegram提供的机器人AP接口,进行开发对接了。
如有转载,请注明出处!《电报(teegram)创建机器人教程》的原文地址:http://www.xiao6.net/post/252.html