Bridge multiple chat platforms (Discord, Telegram, etc.) through Matrix so users can communicate across platforms as themselves.
Discord Channel <--> Matrix Room <--> Telegram Group
- Fully puppeted users (logged into both bridges): Messages appear as their real account on both platforms
- Single-platform users: Messages relay via ghost puppets with their name and avatar -- no account needed on the other platform
- Matrix users: Messages appear as them on all bridged platforms via double puppeting
The superbridge is running on Google Cloud:
| Service | URL |
|---|---|
| Matrix homeserver | https://matrix.35-201-14-61.sslip.io |
| Element Web | https://element.35-201-14-61.sslip.io |
| Synapse Admin | https://synapse-admin.35-201-14-61.sslip.io |
Self-signed SSL: You must accept the certificate warning in your browser before anything will work. Visit the Matrix URL first and click through the warning.
You don't need to install anything. The server is already running.
Open https://matrix.35-201-14-61.sslip.io/_matrix/client/versions in your browser and accept the security warning. You'll see a JSON response -- that means it worked.
Your account is created automatically during deployment. Ask Nick for your username and password.
- Open https://element.35-201-14-61.sslip.io
- Click "Sign In"
- The homeserver should be pre-configured. If prompted, set it to
https://matrix.35-201-14-61.sslip.io - Sign in with your username and password
- In Element, click the + next to "People" to start a new DM
- Search for
@discordbot:35-201-14-61.sslip.ioand start a chat - Send:
login-qr - A QR code appears. Open Discord mobile > Settings > Scan QR Code and scan it
- Confirm on your phone. The bot will say "Successfully logged in as @yourusername"
- Start a new DM with
@telegrambot:35-201-14-61.sslip.io - Send:
login - Send your phone number with country code (e.g.
+61412345678) - Telegram will send you a code. Send it back to the bot
- The bot will say "Successfully logged in as @yourusername"
Once Discord and Telegram are connected:
- Bridged rooms appear in your Element room list
- Your messages on Matrix appear as you on both Discord and Telegram (double puppeting)
- Other people's messages from Discord/Telegram appear with their name and avatar
| You send from | Discord users see | Telegram users see | Matrix users see |
|---|---|---|---|
| Discord | Your message (native) | Your name + message (ghost puppet) | Your name + message |
| Telegram | Your name + message (webhook) | Your message (native) | Your name + message |
| Element | Your message (double puppet) | Your message (double puppet) | Your message (native) |
To bridge a Discord channel with a Telegram group:
-
Bridge the Discord server (if not already done):
- In your
@discordbotDM, send:servers, then select a server andbridge
- In your
-
Find the Telegram chat ID:
- In your
@telegrambotDM, send:sync chats - Or query the database:
SELECT tgid, peer_type, title FROM portal;
- In your
-
Bridge them together -- in the Discord portal room, send:
!tg bridge -<telegram_chat_id> -
Enable relay for non-Discord users:
!discord set-relay --create
GCE e2-medium in australia-southeast1. Managed via Terraform + Ansible.
# Deploy/update
./deploy.sh deploy
# Or manually
cd matrix-docker-ansible-deploy
ansible-playbook -i inventory/hosts-production setup.yml \
--vault-password-file ../.vault-password \
--tags=setup-all,ensure-matrix-users-created,startAll secrets are encrypted with Ansible Vault in production-vault.yml. The vault password is in .vault-password (gitignored) -- ask a teammate for the key.
ansible-vault view production-vault.yml --vault-password-file .vault-passwordSee DEV.md for running the superbridge locally on macOS with Lima.
- True cross-platform puppeting requires users to log into both bridges. This works for the bridge operator but not for casual users.
- Ghost puppets provide the next-best experience: messages show with the sender's name and avatar but come from a bridge bot/webhook.
| File | Purpose |
|---|---|
terraform/ |
GCE infrastructure (Terraform) |
deploy.sh |
Production deployment helper |
production-vault.yml |
Encrypted secrets (Ansible Vault) |
.vault-password |
Vault key (gitignored) |
DEV.md |
Local development setup |
RESEARCH.md |
Research on Matrix bridges |
docs/how-superbridge-works.md |
How Matrix, mautrix, and puppeting work |
docs/matrix-federation.md |
Explanation of Matrix federation |