Giter Club home page Giter Club logo

telegram-message-forwarder-bot's Introduction

Telegram Message Forwarder Bot

A telegram bot, which can forward messages from channel, group or chat to another channel, group or chat automatically.

Deploy

Configuration

To configure this bot add the environment variables stated below. Or add them in config.env.template and change the name to config.env.

  • API_ID - Get it by creating an app on https://my.telegram.org
  • API_HASH - Get it by creating an app on https://my.telegram.org
  • BOT_TOKEN - Get it by creating a bot on https://t.me/BotFather
  • FROM_CHATS - Chat ID of the chats from where to forward messages. Separated by space.
  • TO_CHATS - Chat ID of the chats where to forward messages. Separated by space.
  • TELEGRAM_SESSION - (Optional) If you want to use this bot as user add the telegram session name in environment variables. Get it by running GenString and select the option 1 and follow the instructions.
  • SUDO_USERS - (Optional) Chat identifier of the sudo user. For multiple users use ; as separator.
  • ADVANCE_CONFIG - (Optional) If you want forward message from chat A to chat B and from chat C to chat D add this value in the format given below.
CHAT_ID_A CHAT_ID_B; CHAT_ID_C CHAT_ID_D

Or if you want to forward message from chat A to chat B, C and D. And from Chat E to Chat F

CHAT_ID_A CHAT_ID_B CHAT_ID_C CHAT_ID_D; CHAT_ID_E CHAT_ID_F
     ↑       ^---------------------^         ↑         ↑ to another chat
From channel       To channel        from another channel
  • REMOVE_STRINGS - (Optional) Keywords to remove from message before forwarding. For multiple string use ; as a seperator. For example -
@username;https://t.me/username;Hey! My channel is XXxxXX
  • REPLACE_STRING - (Optional) Keyword to add in the place of REMOVE_STRING

Note

  • Supported identifier for a chat should be the chat id, username or message link.
  • Use /forward command to forward older messages. For message older than 2 days you have to login as a user and set the TELEGRAM_SESSION variable. Command usage - /forward <Chat ID/Username/Message Link> <Limit, No. of Messages to forward> <ID of the last message of from chat to avoid repetition>

Installing Requirements

Install the required Python Modules in your machine.

pip3 install -r requirements.txt

Deployment

With python3.7 or later.

python3 -m bot

Copyright & License

telegram-message-forwarder-bot's People

Contributors

viperadnan-git avatar tompluess 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.