Skip to content

MAymanKH/Bridger

Repository files navigation

Bridger

Simple multi-way bridge between Telegram, Discord, and WhatsApp written in Python


discord.py   pyrogram   neonize   Python

Overview

A lightweight, fully asynchronous Python application that creates multi-way bridges between Telegram chats, Discord channels, and WhatsApp groups/chats. Messages, media, reactions, and reply threads flow seamlessly across any number of configured bridges.

Features

  • Multi-way text bridging — messages sent on any platform in a bridge appear on all others.
  • Reply threading — replies are matched and natively threaded on the receiving platforms.
  • Reaction synchronization — bridge emoji reactions across platforms.
  • Rich media support — photos, videos, audio, voice messages, stickers, and generic documents.
  • Multiple bridges — configure different combinations of chats and platforms together seamlessly.
  • Flexible Telegram auth — works as a bot (bot token) or a user account (phone number).
  • Long message chunking — messages exceeding platform limits are automatically split.
  • Simple to setup — configure settings.yaml and you're ready to go.
  • Docker support — includes a production-ready Dockerfile and docker-compose.yml

Setup

0. Prerequisites

  • Python 3.11+
  • Git
  • Docker and Docker Compose (optional)
  • Make sure they are added to the PATH environment

1. Credentials

  • Discord (Bot): Create a Bot at discord.com/developers and copy the bot token and application ID. Enable all Privileged Gateway Intents (Message Content, Server Members, Presence).
  • Telegram (Bot or User Account): Create an Application at core.telegram.org and copy the API ID and API Hash. Optionally, create a bot and obtain its token from @BotFather if you want a bot setup.
  • WhatsApp (User Account): No prior setup required; you will scan a QR code in the terminal on the first run.

2. Clone the repository

git clone https://github.com/MAymanKH/Bridger.git
cd Bridger

3. Configure settings.yaml

Copy the example config and fill in your credentials:

cp example.settings.yaml settings.yaml
# Platform credentials
# Only include the platforms you want to use.
platforms:
  telegram:
    api_id: 123456
    api_hash: your_api_hash_here
  # Choose ONE authentication method (both are optional — omit both for interactive login):
  # bot_token: your_bot_token   # Run as a Telegram bot
  # phone: +12025551234         # Run as a user account

  discord:
    token: your_discord_bot_token
    app_id: 123456789012345678

# Bridges
# Each bridge links two or more platform chats together.
bridges:
  - name: my work bridge
    platforms:
      telegram: -123456        # Telegram chat ID (include the '-')
      discord: 123456789       # Discord channel ID
      whatsapp: 123456789@g.us  # WhatsApp chat JID

  - name: my homies bridge
    platforms:
      telegram: -654321
      whatsapp: 987654321@g.us

Finding chat IDs:

  • Telegram: Forward a message to @userinfobot or use a Telegram API explorer. Group/channel IDs start with -100.
  • Discord: Enable Developer Mode in settings, right-click a channel → Copy Channel ID.
  • WhatsApp: Learn how to get chat JIDs here.

4a. Run directly with Python

python -m venv venv

source venv/bin/activate # (On Windows: .\venv\Scripts\activate)

pip install -r requirements.txt

python main.py

4b. Run with Docker Compose (recommended for servers)

docker-compose up -d

settings.yaml is mounted read-only into the container. Telegram session data and message queues are stored in named Docker volumes (telegram-sessions, message-data) so they persist across container restarts.

On the first run, if you configured a phone number (user account mode) for Telegram, you will be prompted for a verification code in the terminal. And for WhatsApp, you will be prompted to scan a QR code in the terminal. After a successful login the session is saved and subsequent starts require no interaction.

Notes

  • The Discord bot requires the Message Content privileged intent to read message text.
  • Make sure the Telegram bot has read access to the source chats (add it as an admin).
  • This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.

About

Simple multi-way bridge between Telegram, Discord, and WhatsApp written in Python.

Resources

License

Stars

Watchers

Forks

Contributors