Sign inSign up

aleg94/telegram-forwarder

By aleg94

•Updated about 2 years ago

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

Image
0

790

aleg94/telegram-forwarder repository overview

⁠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_CHAT_USERNAMES: comma separated list of chat's usernames that you'd like to forward messages from (must be present on dialogs)
    • OUTPUT_CHAT_USERNAMES: comma separated list of chat's 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_CHAT_USERNAMES=<username1>,<username2>
      -e OUTPUT_CHAT_USERNAMES=<username3>,<username4>
      -e MESSAGE_PATTERN=<regex>
      aleg94/telegram-forwarder
    

Tag summary

Content type

Image

Digest

sha256:32263d9f2…

Size

29.5 MB

Last updated

about 2 years ago

docker pull aleg94/telegram-forwarder