{"id":16708044,"url":"https://github.com/autogestion/pubgate-telegram","last_synced_at":"2025-04-10T05:22:35.811Z","repository":{"id":150638757,"uuid":"177218127","full_name":"autogestion/pubgate-telegram","owner":"autogestion","description":"Extension for PubGate, Telegram \u003c-\u003e ActivityPub bridge","archived":false,"fork":false,"pushed_at":"2021-12-06T16:03:50.000Z","size":21,"stargazers_count":18,"open_issues_count":1,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-13T21:04:14.175Z","etag":null,"topics":["activitypub","pubgate","sanic","telegram","telethon"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/autogestion.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}},"created_at":"2019-03-22T22:43:05.000Z","updated_at":"2023-08-30T18:21:31.000Z","dependencies_parsed_at":"2023-05-26T03:12:48.669Z","dependency_job_id":null,"html_url":"https://github.com/autogestion/pubgate-telegram","commit_stats":{"total_commits":18,"total_committers":2,"mean_commits":9.0,"dds":0.05555555555555558,"last_synced_commit":"e86b632f37a65fdcaff26a53396be029a6b06bf9"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autogestion%2Fpubgate-telegram","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autogestion%2Fpubgate-telegram/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autogestion%2Fpubgate-telegram/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autogestion%2Fpubgate-telegram/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/autogestion","download_url":"https://codeload.github.com/autogestion/pubgate-telegram/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239157217,"owners_count":19591283,"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":["activitypub","pubgate","sanic","telegram","telethon"],"created_at":"2024-10-12T19:41:54.675Z","updated_at":"2025-02-16T16:31:40.979Z","avatar_url":"https://github.com/autogestion.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## PubGate Telegram \u003c-\u003e ActivityPub bridge\nExtension for [PubGate](https://github.com/autogestion/pubgate), federates Telegram channels and back\n                            \nRequires PubGate \u003e= 0.2.19\n## Deploy\nCreate Telegram bot and invite it to channels going to be bridged with admin permissions\n###### Install Docker + Docker Compose\n#### Shell\n```\ngit clone https://github.com/autogestion/pubgate.git\ncp -r config/extensions_sample_conf.cfg config/conf.cfg\n```\n##### Edit config/conf.cfg to change setup of your instance, next values should be added\n```\nEXTENSIONS = [..., \"pg_telegram\"]\n# These example values won't work. You must get your own api_id and\n# api_hash from https://my.telegram.org, under API Development.\nTELEGRAM_API_ID = 12345\nTELEGRAM_API_HASH = '0123456789abcdef0123456789abcdef'\nTELEGRAM_BOT_TOKEN = \"get from https://core.telegram.org/bots#6-botfather\"\nCHECK_BOXES_TIMEOUT = 3\n```\nThis will connect Telegram bot to PubGate server. To connect it to Fediverse, setup PubGate AP account.\nAccount could be created on deploy by adding next value to config/conf.cfg or later via API (described below)\n```\nUSER_ON_DEPLOY = \"\"\"{\n    \"username\": \"user\",\n    \"password\": \"pass\",                                 \n    \"profile\": {\n        \"type\": \"Service\",                                                  \n        \"name\": \"TelePub\",\n        \"summary\": \"Broadcast from \u003ca href='https://t.me/telapub' target='_blank'\u003eTelegram channel\u003c/a\u003e\",\n        \"icon\": {\n            \"type\": \"Image\",\n            \"mediaType\": \"image/png\",\n            \"url\": \"https://cdn1.iconfinder.com/data/icons/blockchain-8/48/icon0008_decentralize-512.png\"\n        }\n    },\n    \"details\": {\n        \"tgbot\": {\n            \"channels\": [\"\u003cusername_of_telegram_channel\u003e\"],                                    \n            \"enable\": true,\n            \"tags\": [\"telegram\", \"bridge\"]                              \n        }\n    }\n}\"\"\"\n```\nMore on user configuration\n - profile -  contains information which will represent bridge in Fediverse\n - details.tgbot.channels - should be updated with targeted Telegram channel(s)\n - details.tgbot.tags - tags which will be auto-added to every post, could be []\n\n##### Edit requirements/extensions.txt by adding next row\n```\ngit+https://github.com/autogestion/pubgate-telegram.git\n```\n\nThen, instance could be started\n```\ndomain=put-your-domain-here.com docker-compose up -d\n```\n\n### Usage\n\n- To get updates from Telegram channels (where Telegram bot was added) just follow PubGate account from any other AP account\n- To send updates to Telegram, make PubGate account follow targeted accounts (regular AP Follow, via UI or API, endpoint and payload are described in postman collection in [Pubgate repo](https://github.com/autogestion/pubgate/blob/master/pubgate.postman_collection.json)\n\n#### Bots Creation via API\n```\n/user  POST\n```\npayload \n```\nSame as used for USER_ON_DEPLOY value, triple quotes should be stripped\n```\nIf register by invite enabled, \"invite\": \"\u003cinvite_code_from_config/conf.cfg\u003e\" should be added to payload\n\n##### Restart app after adding new bot or updating old one\n\n#### Disable/Update bot\n```\n/\u003cusername\u003e  PATCH   (auth required)\n```\npayload\n```\n{\n    \"details\": {\n        \"tgbot\": {\n            \"channels\": [\"telapub\"],                                    #change to update channel's list\n            \"enable\": false,                                            #\"enable\": true to re-enable\n            \"tags\": [\"telegram\", \"bridge\"]                              \n        }\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fautogestion%2Fpubgate-telegram","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fautogestion%2Fpubgate-telegram","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fautogestion%2Fpubgate-telegram/lists"}