Code Monkey home page Code Monkey logo

telematrix's Introduction

telematrix

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

Usage

After the installation, follow these steps to bridge a matrix room to a telegram group chat or channel:

  • Invite the bot to the telegram chat.
  • Send /alias in the telegram chat.
  • The bot will answer with an alias, something like #telegram_-XXXXXXXXX:yourserver.example. Add that as an alias to the matrix room you want to bridge.

In case it doesn't work make sure that all these are true:

  • You are on the same server as the bridge. If that is not the case, you can't set the alias, because you can only set aliases on the server you are on.
  • The matrix room is not set to invite only. The bridge currently doesn't support invite only rooms, so the rooms must be set to be open for all. Guests access is not required though.

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!

telematrix's People

Contributors

vijfhoek avatar vurpo avatar stonewareslord avatar jcgruenhage avatar expectocode avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.