A simple and interactive Telegram chatbot built using Python. This bot responds to various user commands, provides information, and can be easily customized for different use cases, such as answering FAQs, retrieving data, or offering entertainment through text responses.
- User-Friendly Commands: Responds to user inputs and various commands.
- Modular Codebase: The code is organized to allow easy customization and expansion.
- Easy Setup: Minimal setup required; simply add your Telegram bot token to get started.
- Basic Error Handling: Handles common errors gracefully for a smoother user experience.
- Python 3.x
- Telegram Bot Token: Obtain a token by creating a bot through BotFather on Telegram.
- Clone the repository:
git clone https://github.com/akashch1512/telegram_chatbot.git
- Navigate to the project directory:
cd telegram_chatbot - Install the required packages:
pip install -r requirements.txt
- Set up your Telegram bot token:
- Open
config.py(or wherever the bot token is defined). - Replace
YOUR_TELEGRAM_BOT_TOKENwith your actual bot token.
- Open
- Run the bot:
python bot.py
- Interact with the bot:
- Open Telegram and find your bot by its username.
- Send commands or messages to the bot to start interacting.
- Commands: Add new commands by defining functions in
bot.pyand linking them with desired commands using thedispatcher. - Responses: Modify the bot's responses in each function to suit your needs.
/start- Initiates the bot and provides a welcome message./help- Lists available commands and their descriptions./example_command- Replace this with specific functionality you'd like to add.
The bot includes basic error handling to catch and log issues that may arise during execution. For further customization, add additional error handlers as needed.
Feel free to contribute by submitting pull requests. If you encounter any issues, please open an issue in the repository.