{"id":25986830,"url":"https://github.com/xz-dev/telegramfileuploader","last_synced_at":"2026-02-12T05:51:27.396Z","repository":{"id":225825241,"uuid":"766961495","full_name":"xz-dev/TelegramFileUploader","owner":"xz-dev","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-05T13:03:50.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-03-05T14:43:49.667Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/xz-dev.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}},"created_at":"2024-03-04T13:05:29.000Z","updated_at":"2024-03-04T13:28:49.000Z","dependencies_parsed_at":"2024-03-04T14:41:26.159Z","dependency_job_id":"9a6e8b80-5762-4e76-b7a2-3201a35bcede","html_url":"https://github.com/xz-dev/TelegramFileUploader","commit_stats":null,"previous_names":["xz-dev/telegramfileuploader"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xz-dev%2FTelegramFileUploader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xz-dev%2FTelegramFileUploader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xz-dev%2FTelegramFileUploader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xz-dev%2FTelegramFileUploader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xz-dev","download_url":"https://codeload.github.com/xz-dev/TelegramFileUploader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242030114,"owners_count":20060565,"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":[],"created_at":"2025-03-05T12:33:33.248Z","updated_at":"2026-02-12T05:51:27.390Z","avatar_url":"https://github.com/xz-dev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Telegram File Uploader\n\nA GitHub Action (and standalone CLI tool) for uploading files to Telegram using [Telethon](https://github.com/LonamiWebs/Telethon). Upload build artifacts, logs, or any files directly to a Telegram chat as a grouped message.\n\n## Features\n\n- Upload multiple files as a single grouped message (album)\n- Upload progress reporting\n- Returns message URLs and IDs after upload\n- GitHub Actions outputs for downstream steps\n- Works as a GitHub Action or standalone CLI tool\n- Docker support\n\n## Prerequisites\n\n- Python 3.9+\n- A Telegram Bot Token from [BotFather](https://t.me/botfather)\n- Telegram API credentials (`API_ID` and `API_HASH`) from [my.telegram.org](https://my.telegram.org/)\n\n## Environment Variables\n\n| Variable | Required | Description |\n|----------|----------|-------------|\n| `API_ID` | Yes | Your Telegram API ID (integer) |\n| `API_HASH` | Yes | Your Telegram API hash |\n| `BOT_TOKEN` | Yes | Bot token from BotFather |\n\n## GitHub Action Usage\n\n### Inputs\n\n| Input | Required | Description |\n|-------|----------|-------------|\n| `to-who` | Yes | The recipient (chat ID or username) |\n| `message` | Yes | The message/caption to send with the files |\n| `files` | Yes | File paths to upload, one file per line |\n\n### Outputs\n\n| Output | Description |\n|--------|-------------|\n| `message_url` | URL of the first uploaded message |\n| `message_urls` | Comma-separated URLs of all uploaded messages |\n| `message_id` | ID of the first uploaded message |\n| `message_ids` | Comma-separated IDs of all uploaded messages |\n\n### Example Workflow\n\nCreate `.github/workflows/telegram-upload.yml`:\n\n```yaml\nname: Upload Files to Telegram\n\non: [push]\n\njobs:\n  upload-to-telegram:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v3\n\n    - name: Upload files to Telegram\n      id: upload\n      uses: xz-dev/TelegramFileUploader@v1\n      with:\n        to-who: 'username_or_chat_id'\n        message: 'Here are your files!'\n        files: |\n          /path/to/file1\n          /path/to/file2\n      env:\n        API_ID: ${{ secrets.API_ID }}\n        API_HASH: ${{ secrets.API_HASH }}\n        BOT_TOKEN: ${{ secrets.BOT_TOKEN }}\n\n    - name: Print message URL\n      run: echo \"Uploaded to ${{ steps.upload.outputs.message_url }}\"\n```\n\nSet `API_ID`, `API_HASH`, and `BOT_TOKEN` in your repository's **Settings \u003e Secrets and variables \u003e Actions**.\n\nFor a real-world usage example, see the [UpgradeAll Android CI workflow](https://github.com/DUpdateSystem/UpgradeAll/blob/master/.github/workflows/android.yml).\n\n## Standalone CLI Usage\n\n```bash\npip install -r requirements.txt\n\nexport API_ID=\"your_api_id\"\nexport API_HASH=\"your_api_hash\"\nexport BOT_TOKEN=\"your_bot_token\"\n\npython3 main.py --to \"chat_id_or_username\" --message \"Hello!\" --files \"file1.txt\" \"file2.txt\"\n```\n\n## Docker Usage\n\n```bash\ndocker build -t telegram-uploader .\n\ndocker run \\\n  -e API_ID=\"your_api_id\" \\\n  -e API_HASH=\"your_api_hash\" \\\n  -e BOT_TOKEN=\"your_bot_token\" \\\n  telegram-uploader \\\n  --to \"chat_id_or_username\" --message \"Hello!\" --files \"file1.txt\"\n```\n\n## Running Tests\n\nInstall test dependencies:\n\n```bash\npip install -r requirements.txt pytest pytest-asyncio pytest-dotenv\n```\n\nRun unit tests (no network required):\n\n```bash\npytest tests/test_unit.py -v\n```\n\nRun integration tests (requires Telegram API credentials):\n\n```bash\n# Option 1: environment variables\nexport API_ID=\"your_api_id\"\nexport API_HASH=\"your_api_hash\"\nexport BOT_TOKEN=\"your_bot_token\"\nexport CHAT_ID=\"target_chat_id\"\n\n# Option 2: .env file\ncat \u003e .env \u003c\u003cEOF\nAPI_ID=your_api_id\nAPI_HASH=your_api_hash\nBOT_TOKEN=your_bot_token\nCHAT_ID=target_chat_id\nEOF\n\npytest tests/test_integration.py -v\n```\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxz-dev%2Ftelegramfileuploader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxz-dev%2Ftelegramfileuploader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxz-dev%2Ftelegramfileuploader/lists"}