Go to file
Max Sandholm 89779b4da7 Added reply bridging (#26)
Messages sent from Telegram that are replies to previous messages are now formatted better on Matrix:
The message contains a link to the replied-to message on Matrix, so clicking on it works just like it does on Telegram
Also, the reply quotes the original message.
2017-03-05 12:51:32 +01:00
telematrix Added reply bridging (#26) 2017-03-05 12:51:32 +01:00
.gitignore Add database to gitignore 2016-11-15 07:53:43 +01:00
.travis.yml Fix CI 2016-11-16 14:47:13 +01:00
app_service.py Fix CI 2016-11-16 14:47:13 +01:00
asconfig.yaml.example added example configuration 2016-10-08 18:08:59 +02:00
config.json.example Add a bit more documentation 2016-11-15 07:45:09 +01:00
LICENSE Initial commit 2016-09-13 16:17:11 +02:00
README.md Add last bit of configuration documentation. 2016-11-15 15:26:21 +01:00
requirements.txt Add rudimentary sticker support (#25) 2017-02-20 00:19:40 +01:00

telematrix

A bridge between Telegram and Matrix. Currently under development — this project isn't considered to be in a usable state right now.

Installation

Dependencies

First, create a virtualenv and activate it:

virtualenv venv -p $(which python3)
. venv/bin/activate

Then install the requirements using pip:

pip install -r requirements.txt

Configuration

telematrix configuration

First, copy config.json.example to config.json. Then fill in the fields:

  • tokens.hs: A randomly generated token
  • tokens.as: Another randomly generated token
  • tokens.telegram: The Telegram bot API token, as generated by @BotFather
  • tokens.google: A Google API key, used for URL shortening. Can be left out to disable.
  • hosts.internal: The homeserver host to connect to internally.
  • hosts.external: The external domain of the homeserver, used for generating URLs.
  • hosts.bare: Just the (sub)domain of the server.
  • user_id_format: A Python str.format-style string to format user IDs as
  • db_url: A SQLAlchemy URL for the database. See the SQLAlchemy docs.

Synapse configuration

Copy asconfig.yaml.example to asconfig.yaml, then fill in the fields:

  • url: The host and port of telematrix. Most likely http://localhost:5000.
  • as_token: token.as from telematrix config.
  • hs_token: token.hs from telematrix config.

The rest of the config can be left as is. Finally, add a relative path to this config file in the Synapse's homeserver.yaml:

app_service_config_files:
    - "../telematrix/asconfig.yaml"

Contributions

Want to help? Awesome! This bridge still needs a lot of work, so any help is welcome.

A great start is reporting bugs — if you find it doesn't work like it's supposed to, do submit an issue on Github. Or, if you're a programmer (which you probably are, considering you are on this website), feel free to try to fix it yourself. Just make sure Pylint approves of your code!