{"id":16156780,"url":"https://github.com/hemantapkh/ncellbot","last_synced_at":"2025-03-18T20:30:44.011Z","repository":{"id":52816042,"uuid":"347122880","full_name":"hemantapkh/ncellbot","owner":"hemantapkh","description":"🇳 Free and Open-source Telegram bot to use the services of Ncell App.","archived":false,"fork":false,"pushed_at":"2021-04-24T08:36:40.000Z","size":586,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-28T12:06:41.967Z","etag":null,"topics":["axiata","ncell","ncellapp","ncellbot","telegram-bot"],"latest_commit_sha":null,"homepage":"https://t.me/ncellapp","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/hemantapkh.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}},"created_at":"2021-03-12T16:06:56.000Z","updated_at":"2024-12-01T16:46:05.000Z","dependencies_parsed_at":"2022-08-23T07:41:28.195Z","dependency_job_id":null,"html_url":"https://github.com/hemantapkh/ncellbot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hemantapkh%2Fncellbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hemantapkh%2Fncellbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hemantapkh%2Fncellbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hemantapkh%2Fncellbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hemantapkh","download_url":"https://codeload.github.com/hemantapkh/ncellbot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243950792,"owners_count":20373664,"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":["axiata","ncell","ncellapp","ncellbot","telegram-bot"],"created_at":"2024-10-10T01:46:27.391Z","updated_at":"2025-03-18T20:30:43.664Z","avatar_url":"https://github.com/hemantapkh.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\u003ca href=\"https://github.com/hemantapkh/ncellbot/stargazers\"\u003e\n\u003cimg src=\"https://img.shields.io/github/stars/hemantapkh/ncellbot\" alt=\"Stars\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/hemantapkh/ncellbot/fork\"\u003e\n\u003cimg src=\"https://img.shields.io/github/forks/hemantapkh/ncellbot.svg\" alt=\"Forks\"/\u003e\n\u003c/a\u003e\n\u003cimg src=\"https://visitor-badge.laobi.icu/badge?page_id=hemantapkh.ncellbot\" alt=\"visitors\" /\u003e\n\u003ca href=\"https://github.com/hemantapkh/ncellbot/graphs/contributors\"\u003e\n\u003cimg src=\"https://img.shields.io/github/contributors/hemantapkh/ncellbot.svg\" alt=\"Contributors\" /\u003e\n\u003ca href=\"https://www.youtube.com/c/H9TechYouTube?sub_confirmation=1\"\u003e\n\u003cimg src=\"https://img.shields.io/badge/YouTube-H9-red\" alt=\"Subscribe my channel H9\"/\u003e\n\u003c/a\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"images/ncellbot.jpg\" align=\"center\" height=375 alt=\"Ncell Bot\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://t.me/ncellappbot\"\u003e\n\u003cimg src='https://img.shields.io/badge/Telegram-Active-blue?style=for-the-badge\u0026logo=telegram'\u003e\n\u003c/a\u003e\n\u003ca href=\"https://m.me/ncellappbot\"\u003e\n\u003cimg src='https://img.shields.io/badge/Facebook-Inactive-red?style=for-the-badge\u0026logo=facebook'\u003e\n\u003c/a\u003e\n\u003c/P\u003e\n\u003ch2 align='center'\u003e🤖 Ncell Chat Bot for Telegram\u003c/h2\u003e\n\n\u003cp align=\"center\"\u003e\nNcell bot is a free and open-source telegram bot to use the services of the Ncell App. You can use services like sending SMS, transferring balance, and many more which are not available in the official Ncell chatbot.\n\u003c/P\u003e\n\n---\n\n## ✔️ TODO\n\n* Account sharing\n* Balance transfer\n* Call History\n* Recharge history\n\n---\n\n## 🔐 Privacy\n\nThe bot is designed in a way to protect the privacy of users. You can learn more about this topic [here](https://telegra.ph/Privacy-On-Ncell-App-04-19).\n\n---\n\n## ⚙️ Deployment\n\n\u003cb\u003eCurrently, the latest version of [Ncell App](https://github.com/hemantapkh/ncellapp) is not open-sourced yet. I will try to release a new version as soon as possible.\u003c/b\u003e\n\n* Clone the repository, create a virtual environment, and install the requirements\n\n    ```bash\n    git clone https://github.com/hemantapkh/ncellbot \u0026\u0026 virtualenv ncellenv \u0026\u0026 source ncellenv/bin/activate \u0026\u0026 cd ncellbot \u0026\u0026 pip install -r requirements.txt\n    ```\n\n* Add your bot token in [config.json](config.json) file\n* Run the [migration.py](migrations.py) file to open a database.\n\n    ```python\n    python migrations.py\n    ```\n* Now, start the bot polling\n\n    ```python\n    python telegrambot.py\n    ```\n\n---\n\n## 🚀 Webhook Deployment\n\nWhile polling and webhooks both accomplish the same task, webhooks are far more efficient. Polling sends a request for new events (specifically, Create, Retrieve, and Delete events, which signal changes in data) at a predetermined frequency and waits for the endpoint to respond whereas, webhooks only transfer data when there is new data to send, making them 100% efficient. That means that polling creates, on average, 66x more server load than webhooks. ([r](https://blog.cloud-elements.com/webhooks-vs-polling-youre-better-than-this))\n\n- Generate an SSL certificate\n\n    ```bash\n    \u003e\u003e openssl genrsa -out sslPrivateKey.pem 2048\n    \u003e\u003e openssl req -new -x509 -days 3650 -key sslPrivateKey.pem -out sslCertificate.pem\n    ```\n\n    *\"Common Name (e.g. server FQDN or YOUR name)\" should be your Host IP.*\n\n- Edit [config.json](config.json) file and set\n\n    - **connectionType** == **webhook**\n    - **webhookHost** = **IP/Host where the bot is running**\n    - **webhookPort** = **PORT (Need to be opened)**\n    - **webhookListen** = **0.0.0.0** or **IP address in some VPS**\n    - **sslCertificate** = **Directory of SSL certificate**\n    - **sslPrivateKey** = **Directory of SSL private key**\n\n* And, start the aioHttp server.\n\n    ```python\n    python telegrambot.py\n    ```\n\n---\n\n## 🛺 Auto deployment on every push\n\nYou can set up GitHub actions to update the bot automatically on every push.\n\n- Fork the repository on your GitHub account.\n\n- Create a directory\n    ```bash\n    mkdir /opt/ncell\n    ```\n\n    *You should create a directory with the same name as above inside /opt, or edit the [deploy.yml](.github/workflows/deploy.yml) and [deployScript.sh](.github/workflows/deployScript.sh)*\n\n- Create a virtual environment in the directory with name `ncellenv`\n\n    ```bash\n    virtualenv ncellenv\n    ```\n\n- Clone the repository and install the requirements in the virtual environment\n\n    ```bash\n    git clone https://github.com/hemantapkh/ncellbot \u0026\u0026 cd ncellbot \u0026\u0026 source /opt/ncell/ncellenv/bin/activate \u0026\u0026 pip install -r requirements.txt\n    ```\n\n- Create a database and move the database into `/opt/ncell`\n\n    ```bash\n    python migrations.py \u0026\u0026 mv database.sqlite /opt/ncell\n    ```\n\n- Generate SSH keys for your VPS and keep the private key in your GitHub secrets\n\n    - Create the ssh key pair using the `ssh-keygen` command. You must leave the passphrase empty while generating the SSH key.\n    - Copy and install the public ssh key on the server using `sh-copy-id -i your_public_key user@host` command.\n    - Now, copy the content of the private key and paste it on your GitHub secrets with the name `SSHKEY`. *(Repository settings \u003e\u003e secrets \u003e\u003e New repository secret)*\n\n- Create another GitHub secret with name `HOST` and save your Host IP.\n\n- Edit [config.json](config.json) file and set\n\n    - **database** = **/opt/ncell/database.sqlite**\n    - **errorLog** =  **/opt/ncell/telegram.errors.logs**\n    - If you are using webhooks, copy the SSL certificate and private key in `/opt/ncell` and set\n        - **sslCertificate** == **/opt/ncell/sslCertificate.pem**\n        - **sslPrivateKey** == **/opt/ncell/sslPrivateKey.pem**\n\n- Copy the content of the edited config.json and save it on your repository secrets with name `CONFIG`. Don't forget to wrap the content of config file with single quotes like this `'Content of config.json'`.\n\n- And, start the bot.\n\n    ```bash\n    source /opt/ncell/ncellenv/bin/activate \u0026\u0026 screen -dm python /opt/ncell/ncellbot/telegrambot.py\n    ```\n\nNow, every time you push on the `main` branch, the bot automatically gets updated.\n\n---\n\n## 💚 Contributing\n\nAny contributions you make are **greatly appreciated**.\n\nFor minor fix, you can directly create a pull request and for adding a new feature, let's first discuss it in our [telegram group](https://t.me/h9discussion) or in [GitHub Discussion](https://github.com/hemantapkh/ncellbot/discussions).\n\n---\n\n## 🔑 License\n\nDistributed under the MIT License. See [LICENSE](LICENSE) for more information.\n\n-----\nMade using [Ncell App](https://github.com/hemantapkh/ncellapp) and [pyTelegramBotApi](https://github.com/eternnoir/pyTelegramBotAPI) in Python💙 by [Hemanta Pokharel](https://github.com/hemantapkh/) [[✉️](mailto:hemantapkh@yahoo.com) [💬](https://t.me/hemantapkh) [📺](https://youtube.com/h9youtube)]","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhemantapkh%2Fncellbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhemantapkh%2Fncellbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhemantapkh%2Fncellbot/lists"}