Simple Telegram Bot for forwarding messages easily between various related channels and groups.
Simple Telegram Bot for forwarding messages easily between various related channels and groups.
This bot allows you to automatically forward messages between different channels. We use it on our Student Comitee because we have like 15 different Telegram groups for each commission we are working on. Then, if we want some commission receives some important information, we can automatically forward to them using hashtags at the beggining of the message (or the caption of a media file).
Made with latest version of telepot at the time (12.0) and for Python 3.5.2. And shared with a MIT license.
We will assume you and your friends have Telegram accounts and several telegram chats.
First, you need to create a Telegram bot. Talk with the BotFather and ask it for a bot (and its respective token)
Then, you need to rename the file config-sample.json to config.json. Add in token
property your bot's token.
Also, its very encouraged to set a password for registering to use the bot. If you don't set a password. Any person could use it and forward messages between your channels.
The next part is to install in your server the requirements of the bot using pip3 install -r requirements.txt
.
finally, configure the bot, adding it on all the groups you want to connect
/addme {password}
, where the password is the string set on bot configuration (see previous section for more details)./rmme
. Then you won't be able to send commands to the bot (except for /addme
)/taglist
for a list of tags registered to the bot, and the group/channel/private chat's names/add #{tag}
. You can remove the tag using /rm #{tag}
.Some details about the implementation: