{"id":13467702,"url":"https://github.com/MrMissx/Telegram_Forwarder","last_synced_at":"2025-03-26T03:30:54.151Z","repository":{"id":37682364,"uuid":"262943972","full_name":"MrMissx/Telegram_Forwarder","owner":"MrMissx","description":"Simple telegram bot to forward message from channel/group","archived":false,"fork":false,"pushed_at":"2024-05-18T06:36:31.000Z","size":63,"stargazers_count":491,"open_issues_count":4,"forks_count":460,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-10-29T21:58:56.810Z","etag":null,"topics":["bot","forwarder","telegram","telegram-bot","telegram-forwarder"],"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/MrMissx.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":"2020-05-11T05:07:44.000Z","updated_at":"2024-10-29T18:54:06.000Z","dependencies_parsed_at":"2023-10-13T00:34:35.904Z","dependency_job_id":"2de76d50-d747-4c47-840a-912fd38b8f2e","html_url":"https://github.com/MrMissx/Telegram_Forwarder","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrMissx%2FTelegram_Forwarder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrMissx%2FTelegram_Forwarder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrMissx%2FTelegram_Forwarder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrMissx%2FTelegram_Forwarder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MrMissx","download_url":"https://codeload.github.com/MrMissx/Telegram_Forwarder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245584562,"owners_count":20639574,"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","forwarder","telegram","telegram-bot","telegram-forwarder"],"created_at":"2024-07-31T15:00:59.495Z","updated_at":"2025-03-26T03:30:53.878Z","avatar_url":"https://github.com/MrMissx.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Telegram Forwarder\n\nA simple Telegram Python bot running on Python3 to automatically forward messages from one chat to another.\n\n## Migration from V1\n\nv2 uses a different configuration file format. Please refer to the [Configuration](#configuration) section for more information. The bot will not start if the configuration file is not in the correct format.\n\n## Starting The Bot\n\nOnce you've setup your your configuration (see below) is complete, simply run:\n\n```shell\npython -m forwarder\n```\n\nor with poetry (recommended)\n\n```shell\npoetry run forwarder\n```\n\n## Setting Up The Bot (Read the instruction bellow before starting the bot!):\n\nTelegram Forwarder only supports Python 3.9 and higher.\n\n### Configuration\n\nThere are two files mandatory for the bot to work `.env` and `chat_list.json`.\n\n#### `.env`\n\nTemplate env may be found in `sample.env`. Rename it to `.env` and fill in the values:\n\n- `BOT_TOKEN` - Telegram bot token. You can get it from [@BotFather](https://t.me/BotFather)\n\n- `OWNER_ID` - An integer of consisting of your owner ID.\n\n- `REMOVE_TAG` - set to `True` if you want to remove the tag (\"Forwarded from xxxxx\") from the forwarded message.\n\n#### `chat_list.json`\n\nTemplate chat_list may be found in `chat_list.sample.json`. Rename it to `chat_list.json`.\n\nThis file contains the list of chats to forward messages from and to. The bot expect it to be an Array of objects with the following structure:\n\n```json\n[\n  {\n    \"source\": -10012345678,\n    \"destination\": [-10011111111, \"-10022222222#123456\"]\n  },\n  {\n    \"source\": \"-10087654321#000000\", // Topic/Forum group\n    \"destination\": [\"-10033333333#654321\"],\n    \"filters\": [\"word1\", \"word2\"] // message that contain this word will be forwarded\n  },\n  {\n    \"source\": -10087654321,\n    \"destination\": [-10033333333],\n    \"blacklist\": [\"word3\", \"word4\"] // message that contain this word will not be forwarded\n  },\n  {\n    \"source\": -10087654321,\n    \"destination\": [-10033333333],\n    \"filters\": [\"word5\"],\n    \"blacklist\": [\"word6\"]\n    // message must contain word5 and must not contain word6 to be forwarded\n  }\n]\n```\n\n- `source` - The chat ID of the chat to forward messages from. It can be a group or a channel.\n\n  \u003e If the source chat is a Topic groups, you **MUST** explicitly specify the topic ID. The bot will ignore incoming message from topic group if the topic ID is not specified.\n\n- `destination` - An array of chat IDs to forward messages to. It can be a group or a channel.\n\n  \u003e Destenation supports Topics chat. You can use `#topicID` string to forward to specific topic. Example: `[-10011111111, \"-10022222222#123456\"]`. With this config it will forward to chat `-10022222222` with topic `123456` and to chat `-10011111111` .\n\n- `filters` (Optional) - An array of strings to filter words. If the message containes any of the strings in the array, it **WILL BE** forwarded.\n\n- `blacklist` (Optional) - An array of strings to blacklist words. If the message containes any of the string in the array, it will **NOT BE** forwarded.\n\nYou may add as many objects as you want. The bot will forward messages from all the chats in the `source` field to all the chats in the `destination` field. Duplicates are allowed as it already handled by the bot.\n\n### Python dependencies\n\nInstall the necessary python dependencies by moving to the project directory and running:\n\n```shell\npoetry install --only main\n```\n\nor with pip\n\n```shell\npip3 install -r requirements.txt\n```\n\nThis will install all necessary python packages.\n\n### Launch in Docker container\n\n#### Requrements\n\n- Docker\n- docker compose\n\nBefore launch make sure all configuration are completed (`.env` and `chat_list.json`)!\n\nThen, simply run the command:\n\n```shell\ndocker compose up -d\n```\n\nYou can view the logs by the command:\n\n```shell\ndocker compose logs -f\n```\n\n### Credits\n\n- [AutoForwarder-TelegramBot](https://github.com/saksham2410/AutoForwarder-TelegramBot)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMrMissx%2FTelegram_Forwarder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMrMissx%2FTelegram_Forwarder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMrMissx%2FTelegram_Forwarder/lists"}