mautrix-telegram

Work in progress: Expect bugs, do not use in production.

A Matrix-Telegram puppeting bridge.

Discussion

Matrix room: #telegram:maunium.net

A Telegram chat will be created once the bridge is stable enough.

Usage

Setup

  1. Clone the repository and install packages with npm install.
  2. Create a copy of example-config.yaml and fill out the fields.
  3. Generate the appservice registration with ./mautrix-telegram -g. You can use the -c and -r flags to change the location of the config and registration files. They default to config.yaml and registration.yaml respectively.
  4. Run the bridge ./mautrix-telegram. You can also use forever: forever start mautrix-telegram (probably, I didn't actually test it).
  5. Invite the appservice bot to a private room and view the commands with help.

Logging in

  1. Make sure you have set up the bridge and have an open management room (a room with no other users than the appservice bot).
  2. Request a Telegram auth code with login <phone number>.
  3. Send your auth code to the management room.
  4. If you have two-factor authentication enabled, send your password to the room.
  5. If all prior steps were executed successfully, the bridge should now create rooms for all your Telegram dialogs and invite you to them.

Features & Roadmap

  • Matrix → Telegram
    • Plaintext messages
    • Formatted messages
    • Locations
    • Images
    • Files
    • Message redactions
    • Presence (currently always shown as online on Telegram)
    • Typing notifications (may not be possible)
    • Pinning messages
    • Power level
    • Membership actions (invite, kick, join, leave)
    • Group/channel name/description changes
  • Telegram → Matrix
    • Plaintext messages
    • Formatted messages
    • Images
    • Locations
    • Stickers (somewhat works through document upload, no preview though)
    • Audio messages
    • Video messages
    • Documents
    • Message deletions
    • Presence
    • Typing notifications
    • Pinning messages
    • Admin status
    • Membership actions (invite, kick, join, leave)
    • Group/channel name/description changes
    • Initial group/channel name/description
    • Message edits
  • Initiating chats
    • Automatic portal creation for groups/channels at startup
    • Automatic portal creation for groups/channels when receiving invite/message
    • Private chat creation by inviting Telegram user to new room
    • Joining public channels/supergroups using room aliases
    • Searching for Telegram users using management commands
  • Misc
    • Use optional bot to relay messages for unauthenticated Matrix users
    • Properly handle upgrading groups to supergroups
    • Creating new Telegram groups from Matrix
    • Creating Telegram groups for existing Matrix rooms
Languages
Go 96.5%
Go Template 3%
Teal 0.3%