chat-linker icon indicating copy to clipboard operation
chat-linker copied to clipboard

the bridge between jabber and telegram over chat-bots

chat-linker Build Status

It makes a bridge between different IM-networks via chat-bot

illustration

Usage

Clone or download files

$ git clone https://github.com/jt3k/chat-linker.git

or

$ curl https://codeload.github.com/jt3k/chat-linker/zip/master | tar -xf- -C /path/to/save

Setting

Copy sample-config.json to app-config.json and tune it up.

To determine Telegram room parameters, follow the procedure:

  1. Create a bot according to Telegram documentation

  2. It's essential to disable Privacy mode to make the bot to observe all messages in the room

  3. Manually add a bot to the room (using Telegram's invite functionality)

  4. Send a message to the bot directly, e.g. /my_id @bot_user_id

  5. Visit https://api.telegram.org/bot<bot_api_key>/getUpdates and extract "chat" object from there. E.g.

    {
        "id": -1001054401089,
        "title": "bimo_test",
        "type": "supergroup"
    }
    

Build

$ npm run build

Run

To start the bot:

  • Use the commands npm run prod for production settings or npm run dev for development.

Contribution

Tests

To run tests use following command:

$ npm test

Setting up husky

If after the installation does not work git-hooks then run the following command in project directory.

$ node ./node_modules/husky/bin/install.js

Discussion

FAQ

Does it support bridging more than one room with a single bot?

  • No, it's not yet supported

What types of Telegram groups are supported?

  • The bot supports ordinary groups as well as supergroups.

The bridge only works XMPP -> Telegram, not Telegram -> XMPP.

  • Check the bot privacy settings, then remove the bot from the Telegram chat, and invite it again.

I can't find any id from my room when I go to https://api.telegram.org/bot<bot_api_key>/getUpdates

  • Sometimes the reply to this request is empty, keep on trying.

License

MIT © Andrey Gurtovoy