Git Product home page Git Product logo

telegram-forward-bot's Introduction

telegram-forward-bot

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.

How to install

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

How to use

  1. You need to add yourself to the authorized list of the bot typing /addme {password}, where the password is the string set on bot configuration (see previous section for more details).
  2. If you want to delete your permissions from the bot, you can type /rmme. Then you won't be able to send commands to the bot (except for /addme)
  3. You can use /taglist for a list of tags registered to the bot, and the group/channel/private chat's names
  4. You cand add a tag to a group using /add #{tag}. You can remove the tag using /rm #{tag}.
  5. If you want to send a message/file/image/other to another group, you should add the tags at the start of the message or caption. you can add more than one tag if you want to.
  6. You can forward a message by replying to it with the desired tags. Both messages will be forwarded.

Some considerations

Some details about the implementation:

  1. you can't forward a message to the same chat you wrote it. The bot will warn you and reject to do that if you try to do it.
  2. Each chat can have more than 1 tag. That's very useful if you have various names for your chats, but if you write several times the same tag, or tags that point to the same group, you will have several forwardings to that chat. I plan to correct this some day. (It's not hard but I'm very busy right now).
  3. Any person registered as authorized with the bot can add tags for the chat or another chats. The use of this bot assumes you have authorized users in your chats that you trust. Also, any person registered to the bot can forward messages to any group using the tags.

telegram-forward-bot's People

Contributors

martinligabue avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.