1. Set up your bot
You don’t need to write any code for this. In fact, you don’t even need your computer! Go to the telegram app on your phone and…
- Search for the “botfather” telegram bot (he’s the one that’ll assist you with creating and managing your bot)
- Type
/help
to see all possible commands the botfather can handle - Click on or type
/newbot
to create a new bot.
Follow instructions and make a new name for your bot. If you are making a bot just for experimentation, it can be useful to namespace your bot by placing your name before it in its username, since it has to be a unique name. Although, its screen name can be whatever you like.
I have chosen “Marco Polo Bot” as the screen name and “sohams_marco_polo_bot” as its username. - Congratulations! You have created your first bot. You should see a new API token generated for it (for example, in the previous picture, you can see my newly generated token is
270485614:AAHfiqksKZ8WmR2zSjiQ7_v4TMAKdiHm9T0
). Now you can search for your newly created bot on telegram : - Go ahead and start chatting with your bot!
Well, that’s pretty disappointing. Our bot seems to be stupid, in the sense that it can’t really reply or say anything back. Let’s take care of that by building our bot server which runs on the back end.
2. If it’s your first experience with building APIs, you can easily get the idea using your web browser. Open a new tab in your browser and use the Telegram api URL —
3. Open Telegram, Add "new Bot" to "New Group" and chat anything with your new Bot:
4. Reload Chrome tab: https://api.telegram.org/bot<token>/getUpdates
5. Final get id bot: examble 2546257xx
Không có nhận xét nào:
Đăng nhận xét