This is a Telegram Userbot built with Python and the Pyrogram library. It uses a MongoDB database for data storage and offers a variety of features through a plugin-based architecture.
Key Technologies:
- Programming Language: Python 3.10
- Telegram Library: Pyrogram
- Database: MongoDB
- Dependency Management: pip and
requirements.txt - Deployment: Can be run directly or with Docker.
Project Structure:
userbot/: Main application directory.userbot.py: CoreUserBotclient class.__main__.py: Application entry point.plugins/: Contains the bot's command plugins.database/: Manages the MongoDB database connection and collections.
requirements.txt: Lists all Python dependencies.config/userbot.ini.sample: Sample configuration file.docker-compose.yml: For Docker-based deployment.README.md: Detailed setup and usage instructions.
Features:
The bot provides a wide range of features through its plugins, including:
- Core: AFK status, help, metrics, restart, and update functionality.
- Tools: Carbon code image generation, dictionary, translation, Urban Dictionary, weather, and more.
- Fun: Memes, pats, text replacement, and other entertainment commands.
- Music: Spotify integration and lyrics fetching.
- Admin: Administrative commands for managing the bot.
Setup and Configuration:
- Prerequisites: Python 3.10,
virtualenv, MongoDB, andcarbon-now-cli. - Installation:
- Clone the repository.
- Create and activate a virtual environment.
- Install dependencies from
requirements.txt.
- Configuration:
- Copy
userbot.ini.sampletouserbot.ini. - Fill in the required API keys and settings (Telegram API, MongoDB connection string, etc.).
- Copy
- Running the Bot:
- Run
python -m userbotto start the bot. - Alternatively, use the provided
docker-compose.ymlfor a Docker-based setup.
- Run
Spotify Integration:
To enable Spotify features, you need to:
- Create a Spotify Developer application.
- Set the Redirect URI to
http://localhost:8888/callback. - Add your
CLIENT_IDandCLIENT_SECRETtouserbot.ini. - Run
python spotify.pyto generate a.cachefile, which needs to be in the project root.
Database:
The bot uses MongoDB for various features, including:
- Auto-replies
- PM permit
- User profiles
- Reminders
- Settings
- Sticker deleter
- Summon