ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

创建telegram机器人教程

2022-06-03 17:02:30  阅读:836  来源: 互联网

标签:教程 telegram 机器人 bot ID token API your


首先建立一个bot
tg内搜索botfather,开启与之聊天框,然后输入

/newbot

机器人会反馈

Alright, a new bot. How are we going to call it? Please choose a name for your bot.
 

然后输入你想建立的机器人昵称

回车后你就要输入你需要建立的机器人名字,例如

example_bot

机器人名称必须以_bot结尾
如果名称已被注册会提示Sorry, this username is already taken. Please try something different. 

成功后机器人会反馈类似如下信息

BotFather, [16.02.17 14:23]
Done! Congratulations on your new bot. You will find it at t.me/Gz_David_Bot. 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:
xxx:xxx

For a description of the Bot API, see this page: https://core.telegram.org/bots/api
上述信息里API:后边标红的信息就是你的token,我这里只是示例

输入/token 可以重新生成一个token,/revoke  可以撤销一个token

获取UserID
TG内搜索userinfobot

开启聊天后回复/start

机器人的ID就是你需要的ID号码

使用bot
TG内搜索你建立的机器人名称example_bot

开始对话

再需要推送信息的地方填入API以及ID号,在这个机器人就能收到推送了
来源:https://www.dianjilingqu.com/

标签:教程,telegram,机器人,bot,ID,token,API,your
来源: https://www.cnblogs.com/yuanyuzhou/p/16340173.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有