{"id":13988418,"url":"https://github.com/nuhmanpk/hydrogram-bot","last_synced_at":"2025-08-07T01:33:58.565Z","repository":{"id":245553673,"uuid":"818593140","full_name":"nuhmanpk/hydrogram-bot","owner":"nuhmanpk","description":"Template for Hydrogram bot - A pyrogram alternative","archived":false,"fork":false,"pushed_at":"2024-08-12T10:17:10.000Z","size":38,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-03T06:54:52.367Z","etag":null,"topics":["bot","bot-template","hydrogram","hydrogram-bot","hydrogram-bot-template","pyrogram-bot","pyrogram-v2","telegram","telegram-api","telegram-bot","template"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nuhmanpk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-22T09:19:09.000Z","updated_at":"2024-12-01T17:53:30.000Z","dependencies_parsed_at":"2024-08-12T11:39:59.696Z","dependency_job_id":"753a9c3e-0488-469e-ac04-9e9ac2ae7b49","html_url":"https://github.com/nuhmanpk/hydrogram-bot","commit_stats":null,"previous_names":["nuhmanpk/pyrogram-bot"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/nuhmanpk/hydrogram-bot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuhmanpk%2Fhydrogram-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuhmanpk%2Fhydrogram-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuhmanpk%2Fhydrogram-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuhmanpk%2Fhydrogram-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nuhmanpk","download_url":"https://codeload.github.com/nuhmanpk/hydrogram-bot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuhmanpk%2Fhydrogram-bot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265798429,"owners_count":23829945,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bot","bot-template","hydrogram","hydrogram-bot","hydrogram-bot-template","pyrogram-bot","pyrogram-v2","telegram","telegram-api","telegram-bot","template"],"created_at":"2024-08-09T13:00:59.281Z","updated_at":"2025-07-18T17:06:22.073Z","avatar_url":"https://github.com/nuhmanpk.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Hydrogram-bot\nThis is a template for a [Hydrogram](https://hydrogram.org/) bot using the Hyrogram framework a Pyrogram Alternative. Follow the steps below to set up and run the bot.\nFor better developer experience install [this](https://marketplace.visualstudio.com/items?itemName=nuhmanpk.pyrosnippets) code snippet extenstion.\n\n# Prerequisites\n  - Python 3.8 or higher\n  - MongoDB\n  - Telegram account\n\n# Getting Started\n1. Clone the Repository \n   Clone this repository to your local machine using:\n   \n    ```sh\n    git clone https://github.com/nuhmanpk/hydrogram-bot.git\n    cd hydrogram-bot\n    ```\n2. Create a Virtual Environment\n  Create a virtual environment to manage dependencies:\n\n    ```sh\n    python3 -m venv venv\n    ```\n    Activate the virtual environment:\n\n    On Windows:\n\n      ```sh\n      venv\\Scripts\\activate\n      \n      ```\n    On macOS/Linux:\n   \n      ```sh\n      source venv/bin/activate\n      ```\n3. Install Dependencies\n   Install the required Python packages:\n   \n     ```sh\n     pip install -r requirements.txt\n     ```\n\n4. Obtain Required Values\n    You need to gather the following values to configure your bot:\n\n      - DATABASE_URL: The URL for your [MongoDB](https://mongodb.com) database.\n      - DATABASE_NAME: The name of your [MongoDB](https://mongodb.com) database.\n      - BOT_TOKEN: Your bot token from [BotFather](https://t.me/botfather) on Telegram.\n      - API_ID: Your API ID from [my.telegram.org](https://my.telegram.org).\n      - API_HASH: Your API hash from [my.telegram.org](https://my.telegram.org).\n\n5. Set Environment Variables\n  Create a .env file in the root of your project directory and add the following content:\n    ```\n    DATABASE_URL=your_mongodb_url\n    DATABASE_NAME=your_database_name\n    BOT_TOKEN=your_bot_token\n    API_ID=your_api_id\n    API_HASH=your_api_hash\n    ```\n    Replace the placeholders (your_mongodb_url, your_database_name, your_bot_token, your_api_id, your_api_hash) with your actual values.\n\n\n6. Run the Bot\n  Finally, run the bot with:\n    ```\n    python3 main.py\n    ```\n\n# Connect to Your VM\n1. Install PM2\n  Install PM2, a process manager for Node.js applications that can also be used to manage Python     processes:\n\n   ```sh\n   sudo npm install pm2 -g\n   ```\n\n2. Start the Bot with PM2\n    1. Start your bot using PM2:\n\n    ```sh\n    pm2 start python3 --name hydrogram-bot -- main.py\n    ```\n    2. To make PM2 start on system boot:\n  \n    ```sh\n    pm2 startup\n    pm2 save\n    ```\n   \n3. Monitor and Manage Your Bot\n  You can manage your bot with PM2 using the following commands:\n\n    1. List running processes:\n  \n    ```sh\n    pm2 list\n    ```\n    2. Stop the bot:\n  \n    ```sh\n    pm2 stop hydrogram-bot\n    ```\n    3. Restart the bot:\n  \n    ```sh\n    pm2 restart hydrogram-bot\n    ```\n  \n    4. View logs:\n  \n    ```sh\n    pm2 logs hydrogram-bot\n    ```\n\n\nHappy Coding ... 🚀\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuhmanpk%2Fhydrogram-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnuhmanpk%2Fhydrogram-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuhmanpk%2Fhydrogram-bot/lists"}