This bot listens to messages sent in Topic 1 of Group A and forwards them to Topic 2 in Group B.
-
Install the required library:
pip install python-telegram-bot
-
How to set up the bot and obtain a Telegram bot token : Create a new bot using the BotFather on Telegram. after creating the bot,the botfather will provide token, Save the token provided by BotFather.
-
Retrieve Group and Topic IDs : Open telegram and create Group A and create Topic1 inside it. Now click on topic1(settings), You can see the topic link in info section. for example: t.me/c/2260671564/2 (the number after last slash is your TopicID & number after second last slash is Group ID) NOTE : GROUP ID'S ARE ALWAYS NEGATIVE,and starts with 100, SO PUT (-100) BEFORE ANY GROUP ID