7/8/2023 0 Comments Create telegram bot tutorial![]() Then type any message that you want such as “test bot” or anything you want.Īfter writing “test bot” to your bot now go to the Vscode you will file the following JSON in your terminal. In BotFather where you get the token for your Telegram chatbot, you can also file the URL to redirect to your Telegram bot.Īfter that click on the Start Bot to start the chat with the bot. Now open VS Code and add the following code and run it on the same Ngrok link on which you had run the previous code. Now we will need to get the JSON response from the telegram bot for any text that we write to the bot. Īfter running the link in your web browser you will get the response shown in the bellow image. You can do it by running the link in your browser. Now you will need to set the webhook for the telegram bot. You will see the response “Welcome!” same as the previous step. Go to the Ngrok and type the command “ngrok http 5000” after running this command you will get the links.įrom that Ngrok links copy the HTTPS link and paste it to your browser. When you run the code you will get the link for the server like “ ” click on that link you will be redirected to the webpage where you will see the response “Welcome!” Run this code to check whether the flask app is running correctly or not. $ pip install Flask from flask import Flask Step 7: Creating a flask app for the webhook response.įirst of all, you will need to install python and flask on your computer. Keep your token secure and store it safely. it contains a token to access the HTTP API. Step 6: After giving a unique username you will get a message like the below. ![]() Step 5: Now type a unique username for your bot. ![]() Step 2: Click on the “BotFather” and Click on the “Start” button. Step 1: Open your telegram account and in the search bar type “BotFather”. Here we learn how we can get different types of responses from the bot such as:įollow the below instructions to make a Telegram chatbot. In this tutorial, we will learn about how we can create a Telegram chatbot and use it to prepare text messages with rich responses. On platforms such as Facebook, Google, and others, we can develop chatbots. For engaging conversations, the automated chatbot is really beneficial.
0 Comments
Leave a Reply. |