Website/Bridging Telegram groups with IRC

    From The Document Foundation Wiki

    Some discussion fora / user groups conduct their business mostly on IRC, some on Telegram, and some on Matrix. At some point, you may reach the decision you want to support more than one of these media. This page regards Telegram and IRC.

    So, suppose we have a Telegram group (or supergroup, or channel) named "LibreOffice foo", and you want people to also be able to use IRC: To read discussions and participate in them, without being on Telegram - and with the Telegram users in the grou to being able to read and respond to those users on IRC. Alternatively, you may be in the opposite scenario: You have a working IRC channel, say #libreoffice-foo and want it to also work as a Telegram group.

    You're in luck! The TDF infrastructure team maintains a "bridging" or echoing mechanism to enable this happening. However - the infra team is not able to set this up all on its own, because it has no control of your Telegram group; and also for reasons of tradition/history. So, you'll have to go to a bit of hassle to help them make it happen.

    Preliminaries

    Before you can bridge a Telegram group and an IRC channel, they must both exist. so:

    • If you started with #libreoffice-foo on libera.chat, create the new group "LibreOffice foo" on Telegram. You will be an administrator, having created the group. Note that the IRC channel should already be recognized by / registered via the TDF infra team.
    • If you started with the Telegram group "LibreOffice foo":
      1. Reach out the infrastructure team (by email or on IRC at #tdf-infra IRC://) and ask them to register the #libreoffice-foo channel for you.
      2. In the "LibreOffice foo" telegram group, gain admin privileges (or ask an admin to perform the following instead of you).

    Phase I: Bot creation on Telegram

    1. Add the user @getidsbot (full name "GetIDs Bot") to the "LibreOffice foo" group.
      Upon joining The "GetIDs Bot" will emit a message to the channel containing, among other things, its numeric group ID. Note that the ID is a _negative_ number.
    2. Save the group ID somewhere.
    3. Remove @getidsbot bot as group member.
    4. Conduct a chat with user @BotFather:
      1. Say: /start
        .The @BotFather should emit a list of commands.
      2. Say: /newbot
        The @BotFather should ask for the bot full name.
      3. Say the new bot's full name, e.g. LibreOffice foo Telegram<->IRC Bridge.
        The @BotFather should ask for the bot's user handle / username.
      4. Say the new bot's user handle, e.g.LibreOfficeFooIRCBridgebot (no @-sign!).
        The @BotFather should report success in creating the bot, and provide its API key. It's a long(ish) alphanumeric string with a colon in the middle.
      5. Say: /setprivacy
        The @BotFather should give you a selection of bots.
      6. Choose the bot you've just created (by clicking its user handle).
        The @BotFather will ask you for the value to set.
      7. Click "Disable".
        The @BotFather should acknowledge having disabled "privacy mode" for the bot.
    5. Make a copy of the bot username, full name and API key from the Telegram chat logs - just in case.

    Phase II: Provide the infra team with bot details

    Get in touch with infrastructure team and let them know

    • the IRC channel name, for instance #libreoffice-foo;
    • optionally, a desired username for the bridge on the IRC side, for instance lo-foo-tg;
    • the ID of the Telegram group; and
    • the API key of the Telegram bot.

    Wait for the infra team to acknowledge they have set up the bridging. Ensure that the bridge (nickname lo-foo-tg or similar) has joined your IRC channel.

    You can also reach out the infrastructure team on IRC at #tdf-infra IRC://, but make sure not to paste key material or write sensitive information there.

    Phase III: On Telegram

    1. Add the bot @LibreOfficeFooIRCBridgebot to group "LibreOffice foo".
    2. Test the IRC->Telegram bridging: Write a message on the IRC channel #libreoffice-foo
      The bot should emit the same message, prefixed by your IRC username, in the "LibreOffice foo" Telegram group.
    3. Test the Telegram->IRC bridging: Write a message in the "LibreOffice foo" group.
      The bot should emit the same message, prefixed by your Telegram username, on the #libreoffice-foo IRC channel.

    That's it! You're done. You may want to announce these changes on your group/channel.