Prince
Prince Author of Genesis, A technical consultant with experience in Information technology and services. Love exploring and developing new innovative and interesting stuffs. Knowledgeable in an assortment of programming languages, scripting languages, operating systems, and applications.

My First bot - Telegram bot | python

My First bot - Telegram bot | python

Telegram bots are simply accounts operated by software – not people. They will be coded with AI intelligence, so that they can do anything like teach, play, search, broadcast, remind, connect, integrate with other services, or even pass commands to the Internet of Things.

The below are some of the bots available. You can search for their name in the search box and try it out to get idea on how does it work,

  • @PollBot – add this one to group chats to create polls.
  • @RateStickerBot – discover and rate new stickers.
  • @AlertBot – set a time and this bot will send you a reminder for anything you like.
  • @HotOrBot – find friends with this Tinder-like dating bot.
  • @GithubBot – track GitHub updates.
  • @StoreBot – find new bots and rate them.

It is very easy to create your own bot in telegram. All you have to do is use the @BotFather

walking

Type in /start and you can give your bot name and user name for the initial account creation. Then it will give you API secure token which you can use it in your code to control the bot.

Botfather

Your telegram bot is ready now. A typical link to a bot looks like this:

https://telegram.me/your_bot

Opening such a link starts a chat with that bot if you have Telegram installed. These links are easy to identify because all bot usernames must end in bot. If the bot developer wants to pass their bot some additional info (like an auth key for example, see deep linking), the link might also look like this:

https://telegram.me/your_bot?start=value

To get response from your bot, you need to include your API key with your code to control your bot. Your code can be in any language like GO, python, Java.

Here I used Python.

Please use your API token key and you can change the Bot name as per your requirement. After you run the python code, then you could see response from your Bot.

Botfather

Hope this is useful. Would explore more on this and will share in coming days.

comments powered by Disqus