{"id":18683030,"url":"https://github.com/numbersprotocol/telegram-archive-bot","last_synced_at":"2025-11-07T18:30:24.293Z","repository":{"id":103178399,"uuid":"465590953","full_name":"numbersprotocol/telegram-archive-bot","owner":"numbersprotocol","description":"Telegram Archive Bot creates Archives consisting of the received messages and attachments every 60 seconds.","archived":false,"fork":false,"pushed_at":"2022-04-04T02:12:43.000Z","size":44,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-12-27T23:42:29.619Z","etag":null,"topics":["archive","bot","starling","telegram","telegram-bot"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/numbersprotocol.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-03-03T06:10:18.000Z","updated_at":"2022-04-07T13:19:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"ddfd446e-f02c-4cf4-a086-bcaab3cca717","html_url":"https://github.com/numbersprotocol/telegram-archive-bot","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numbersprotocol%2Ftelegram-archive-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numbersprotocol%2Ftelegram-archive-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numbersprotocol%2Ftelegram-archive-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/numbersprotocol%2Ftelegram-archive-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/numbersprotocol","download_url":"https://codeload.github.com/numbersprotocol/telegram-archive-bot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239534535,"owners_count":19654885,"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":["archive","bot","starling","telegram","telegram-bot"],"created_at":"2024-11-07T10:13:33.065Z","updated_at":"2025-11-07T18:30:24.252Z","avatar_url":"https://github.com/numbersprotocol.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Telegram Archive Bot (TAB)\n\nTelegram Archive Bot creates Archives consisting of the received messages and attachments every 60 seconds.\n\nArchives are Zip files stored in `archive/`.\n\nBefore creating an archive, TAB puts the messages and attachments in the temporary directory `data/`.\n\n## Register a Telegram Bot\n\nYou need to register a Telegram Bot and get its access token before running TAB.\n\nSteps to register a Telegram Bot and get its access token:\n\n1. Install a Telegram app on your mobile or desktop.\n2. Search `@botfather` and start a conversation.\n3. Send `/newbot`.\n4. Enter bot username and bot name\n5. BotFather will send a message including:\n    * Bot link: You can start a conversation with the bot by clicking the link.\n    * HTTP API Token (Access Token): Write down the token. It is necessary to run TAB.\n\n## Create Configuration\n\n```\nmkdir -p ~/.config/telegram-archive-bot/\ncp config.json.example config.json\n```\n\nPut your Telegram bot's access token into `config.json`.\n\n```\ncp config.json ~/.config/telegram-archive-bot/config.json\n```\n\n## Execute Telegram Archive Bot\n\n### Run in Local\n\nCreate the execution environment\n\n```\nvirtualenv -p python3 venv\nsource venv/bin/activate\npython3 -m pip install python-telegram-bot logzero\n```\n\nRun TAB\n\n```\npython3 telegram_archive_bot.py --token ~/.config/telegram-archive-bot/config.json [--debug]\n```\n\nor\n\n```\npython3 telegram_archive_bot.py --token \u003cbot-access-token\u003e [--debug]\n```\n\n### Run with docker compose\n\n```\n$ docker-compose up -d\n```\n\nThere will be a log file `telegram.log` in the directory where `telegram_archive_bot.py` is.\n\nNow, you can send messages and files to TAB, and TAB will create Archives in `archive/` every 60 seconds.\n\n## Enable Bot to Collect And Archive Messages in Group\n\nYou can invite TAB to a group to collect and archive messages in the background.\n\nIt's necessary to adjust bot's configuration. You need to chat with botfather and disable the privacy mode\n\n![image info](https://user-images.githubusercontent.com/45333055/157828711-296aa904-fc19-497b-acbf-b251228bad98.png)\n\nadd Group Privacy\n\n![image info](https://user-images.githubusercontent.com/45333055/157828723-a6c05855-b55e-4f44-9de5-63c0cc1ee4cf.png)\n\n## (Optional) Echo Bot with Restful API\n\nFor demonstrating how to integrate Telegram Bot and Restful API together.\n\n### Local development\n\n```\n  $ cd telegram_bot_backend\n  $ cp .env.example .env\n  # Edit .env to fill in desired environment variables\n  $ cd app\n  $ cp ../.env .env\n  $ poetry install\n  $ poetry run uvicorn main:app --reload --host 0.0.0.0 --port ${port}\n  # The server would be listening on localhost:{port} now\n```\n\n### Run with docker compose\n\n```\n$ cd backend\n$ cp .env.example .env\n# Edit .env to fill in desired environment variables\n$ docker-compose up -d\n```\n### chatbot webhook setting\n\nsend this get request\n```\nhttps://api.telegram.org/bot${your api token}/setWebhook?url=${your deploy url}/hook\n```\nand then you need to get this result\n```\n{\"ok\":true,\"result\":true,\"description\":\"Webhook was set\"}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumbersprotocol%2Ftelegram-archive-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnumbersprotocol%2Ftelegram-archive-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnumbersprotocol%2Ftelegram-archive-bot/lists"}