Coder Social home page Coder Social logo

telegram-forwarder's Introduction

telegram-forwarder

Forward messages that match a specific pattern from multiple Telegram chats to one or more chats.

Requirements

  • Docker

Installation and usage

  1. Pull the Docker image from the DockerHub:

    docker pull aleg94/telegram-forwarder
    
  2. Create a Telegram session by getting developer's api id and api hash from here and running the command:

    docker run -it --rm aleg94/telegram-forwarder python ./scripts/create_session.py --api-id <api-id> --api-hash <api-hash>
    

    Follow the on-screen instructions and enter your confirmation code and password (if two-factor authentication is enabled).

  3. Run the image in a container providing the following environment variables:

    • API_ID: the api id associated with your Telegram account
    • API_HASH: the api hash associated with your Telegram account
    • SESSION: the session obtained in step 2
    • INPUT_CHATS: comma separated list of chat's ids or usernames that you'd like to forward messages from (must be present on dialogs)
    • OUTPUT_CHATS: comma separated list of chat's ids or usernames that you'd like to forward messages to (must be present on dialogs)
    • MESSAGE_PATTERN: a regular expression that messages must match to be forwarded

    docker run --name telegram_forwarder -d
      -e API_ID=<api-id>
      -e API_HASH=<api-hash>
      -e SESSION=<session>
      -e INPUT_CHATS=<id1>,<username2>
      -e OUTPUT_CHATS=<username3>,<id4>
      -e MESSAGE_PATTERN=<regex>
      aleg94/telegram-forwarder
    

telegram-forwarder's People

Contributors

aleg94 avatar

Stargazers

 avatar  avatar

Watchers

 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.