{"id":20884326,"url":"https://github.com/kingarthurwashere/django-telegram-bot","last_synced_at":"2026-04-25T13:35:25.115Z","repository":{"id":177291502,"uuid":"540474968","full_name":"kingarthurwashere/django-telegram-bot","owner":"kingarthurwashere","description":"Telegram bot for this ecommerce django app","archived":false,"fork":false,"pushed_at":"2022-09-23T14:21:48.000Z","size":252,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-19T10:42:22.597Z","etag":null,"topics":["django-rest-framework","docker-compose","telegram-bot-api"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kingarthurwashere.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":"2022-09-23T14:18:38.000Z","updated_at":"2024-10-28T23:26:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"c45e8357-f30c-4db5-a4b3-66e36da44335","html_url":"https://github.com/kingarthurwashere/django-telegram-bot","commit_stats":null,"previous_names":["kingarthurwashere/django-telegram-bot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kingarthurwashere%2Fdjango-telegram-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kingarthurwashere%2Fdjango-telegram-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kingarthurwashere%2Fdjango-telegram-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kingarthurwashere%2Fdjango-telegram-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kingarthurwashere","download_url":"https://codeload.github.com/kingarthurwashere/django-telegram-bot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243267122,"owners_count":20263798,"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":["django-rest-framework","docker-compose","telegram-bot-api"],"created_at":"2024-11-18T08:09:42.493Z","updated_at":"2025-12-27T17:12:41.492Z","avatar_url":"https://github.com/kingarthurwashere.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# django-telegram-bot\nSexy Django + python-telegram-bot + Celery + Redis + Postgres + Dokku + GitHub Actions template. Production-ready Telegram bot with database, admin panel and a bunch of useful built-in methods.\n\n[![Sparkline](https://stars.medv.io/ohld/django-telegram-bot.svg)](https://stars.medv.io/ohld/django-telegram-bot)\n\n\n### Check the example bot that uses the code from Main branch: [t.me/djangotelegrambot](https://t.me/djangotelegrambot)\n\n## Features\n\n* Database: Postgres, Sqlite3, MySQL - you decide!\n* Admin panel (thanks to [Django](https://docs.djangoproject.com/en/3.1/intro/tutorial01/))\n* Background jobs using [Celery](https://docs.celeryproject.org/en/stable/)\n* [Production-ready](https://github.com/ohld/django-telegram-bot/wiki/Production-Deployment-using-Dokku) deployment using [Dokku](https://dokku.com)\n* Telegram API usage in polling or [webhook mode](https://core.telegram.org/bots/api#setwebhook)\n* Reverse geocode of user via [ArcGis](https://www.arcgis.com/)\n* Export all users in `.csv`\n* Native telegram [commands in menu](https://github.com/ohld/django-telegram-bot/blob/main/.github/imgs/bot_commands_example.jpg)\n  * In order to edit or delete these commands you'll need to use `set_my_commands` bot's method just like in [tgbot.dispatcher.setup_my_commands](https://github.com/ohld/django-telegram-bot/blob/main/tgbot/dispatcher.py#L150-L156)\n\nBuilt-in Telegram bot methods:\n* `/broadcast` — send message to all users (admin command)\n* `/export_users` — bot sends you info about your users in .csv file (admin command)\n* `/stats` — show basic bot stats \n* `/ask_for_location` — log user location when received and reverse geocode it to get country, city, etc.\n\nCheck out our [Wiki](https://github.com/kingarthurwashere/django-telegram-bot/wiki) for more info.\n\n# How to run\n\n## Quickstart: Polling \u0026 SQLite\n\nThe fastest way to run the bot is to run it in polling mode using SQLite database without all Celery workers for background jobs. This should be enough for quickstart:\n\n``` bash\ngit clone https://github.com/kingarthurwashere/django-telegram-bot\ncd django-telegram-bot\n```\n\nCreate virtual environment (optional)\n``` bash\npython3 -m venv dtb_venv\nsource dtb_venv/bin/activate\n```\n\nInstall all requirements:\n```\npip install -r requirements.txt\n```\n\nCreate `.env` file in root directory and copy-paste this:\n``` bash \nDJANGO_DEBUG=True\nDATABASE_URL=sqlite:///db.sqlite3\nTELEGRAM_TOKEN=\u003cENTER YOUR TELEGRAM TOKEN HERE\u003e\n```\n\nRun migrations to setup SQLite database:\n``` bash\npython manage.py migrate\n```\n\nCreate superuser to get access to admin panel:\n``` bash\npython manage.py createsuperuser\n```\n\nRun bot in polling mode:\n``` bash\npython run_polling.py \n```\n\nIf you want to open Django admin panel which will be located on http://localhost:8000/tgadmin/:\n``` bash\npython manage.py runserver\n```\n\n## Run locally using docker-compose\n\nIf you like docker-compose you can check [full instructions in our Wiki](https://github.com/ohld/django-telegram-bot/wiki/Run-locally-using-Docker-compose).\n\n## Deploy to Production \n\nRead Wiki page on how to [deploy production-ready](https://github.com/ohld/django-telegram-bot/wiki/Production-Deployment-using-Dokku) scalable Telegram bot using Dokku.\n\n----\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkingarthurwashere%2Fdjango-telegram-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkingarthurwashere%2Fdjango-telegram-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkingarthurwashere%2Fdjango-telegram-bot/lists"}