![]() ![]() Right now, our bot won't reply to anything you send it, as it doesnt have any backend code yet. You should see the bot and be able to start a conversation with it. To see if your bot was successfully created, search for the bot's username. Make sure to save this token somewhere safe and private. This is a string that enables your bot to send requests to the Telegram Bot API, similar to the authorisation tokens we used to retrieve weather and exchange rate data in the personal API tutorial. Once you've chosen a username, the BotFather will reply with an authorisation token. Choose a username for your bot (must end in "bot").From the chat interface, follow these steps: Search for "BotFather" and initiate a chat. Once you have a Telegram account, you can register a new bot by sending a message to BotFather, a bot managed by Telegram themselves. You can use Telegram from either your PC or your phone, or both. To create a Telegram bot, we need to download Telegram and create a user account. Registering a Bot Account and Talking to the BotFather Commands sent to the bot's account on Telegram will be passed to the bot's backend code (in our case, this will be the code we host on Code Capsules).įor example, when we send the command /weather to our bot later in this article, the bot will reply with the weather data from our personal API. Users interact with Telegram bots by messaging them with commands – these are words preceded by a forward slash, e.g. Telegram bots appear as contacts on the Telegram interface. An API on Code Capsules, created using the Personal API tutorial.Along the way, we'll learn some key concepts about hosting bots securely and efficiently. We'll also learn how to host this bot on Code Capsules so it can be used by others. This will allow us to pull temperature, weather and exchange rate data on the go by messaging our bot in the Telegram app. In this tutorial, we'll create a client for this API in the form of a Telegram bot. In a previous tutorial, we created and hosted an API on Code Capsules. How to Create and Host a Telegram Bot on Code Capsules Game Catalogue API with Node.js and MySQL Stripe Checkout and Email Subscription with Flask Registering a Bot Account and Talking to the BotFatherĬreating a virtual environment and installing requirements ![]()
0 Comments
Leave a Reply. |