A is a simple Telegram bot that responds to users automatically when they communicate with it.
Test the bot here 👉 Chat-Bot
The first thing you need to do is tell Telegram that you want to create a bot. For this, you’ll need a Telegram account – install their app on your phone, and get it set up.
Next, start a conversation with the “BotFather”. This is a bot that Telegram themselves run, and it controls the creation and registration of bots on their platform. On the Android version of their app, here’s what you do (other platforms are similar)
So, even if your bot isn't very vocal right now, let's double-check that it's been made. Start a conversation with it by following the same steps that you did with the BotFather. Hopefully, you'll be able to find it and start a chat, but nothing happens when you hit the "Start" button.
No big surprise there. Let’s make it do something.
Begin the installation process after the bot has been created.
The steps to execute this on your local machine are as follows:
git clone https://github.com/amrohan/ChatBot
pip install -r requirement.txt
OR
You can manually install packages by using the commands listed below.
pip install python-telegram-bot
Because with dot env installed, we can save and import our telegram bot api key.
pip install python-dotenv
Create .env file in the root folder of your cloned GitHub repo and add your botfather telegram bot token.
API_KEY = {Telegram Bot Token}
Now just run the [main.py](http://main.py)
in terminal.
Now that your python bot is fully functional, simply modify the file in response py to add responses, and in mainpy, you'll notice def functions that are used in the telegram bot. Simply build the function and add it to the command handeler.
That's how you got your Telegram bot up and running on Heroku.
If you have any questions or don't understand any of the instructions, please let me know. 👉 @amrohan .