This is a template for creating Telegram bots using Pyrogram, MongoDB, and Python.
- Python 3.7 or higher
- Pyrogram library
- MongoDB
-
Clone the repository:
git clone https://github.com/kalanakt/Pyrogram-Telegram-Bot-Template telegrambot cd telegrambot
-
Install the dependencies:
#optional python3 -m venv env source env/bin/activate # in mac OS env/Scripts/activate.bat #In CMD env/Scripts/Activate.ps1 #In Powershel
pip install -r requirements.txt
-
Set up your MongoDB database and get the connection URI.
-
Create a
.env
file in the project root and add your MongoDB connection URI and your Telegram bot token:DATABASE_URI=your-mongodb-connection-uri DATABASE_NAME=your-database-name API_ID=your-api-id API_HASH=your-api-hash BOT_TOKEN=your-bot-token
-
Run the bot:
python bot.py
- Pyrogram framework for interacting with the Telegram API.
- MongoDB for storing data.
- Easily extendable for adding more features.
Contributions are welcome! Please follow the standard guidelines when contributing.
This project is licensed under the MIT License.