# How to set up a Telegram-Mattermost link

We have a **Matterbridge** service, which enables you to link a **Telegram channel** or group to a **Mattermost channel**.

The purpose of this service is to reduce the number of communication tools you have to use.

Rebels who are comfortable with Mattermost can keep in touch with Telegram channels, **without** having to join the Telegram channel.

Likewise, rebels who do not want to use Mattermost, but want to stick with Telegram can do so, **without** being in a Telegram only silo.

The link can be **one-way** or **two-way**. For instance, the Rebellion Broadcast and Movement Broadcast channels are **one-way**, from Telegram to Mattermost, where only the Telegram channel members and admins can post to it. Mattermost readers of Telegram channel posts may reply on the Mattermost channel but these posts are not subsequently passed to the Telegram channel. (NOTE: Hub Admins can set a Mattermost channel to Broadcast Only, so people not in the Hub Group who own the channel have their posts removed every night.)

A group that has a thriving Telegram channel, with some people who do not want to use Mattermost, could set up a **two-way** Matterbridge link. This enables posts to be made **and shared** from either platform. Subsequently, members who **do** use Mattermost can **leave** the Telegram channel, whilst **remaining in** the overall conversation.

### Prerequisites

It is **very important** that people in the existing channel or group know **beforehand** if you intend to set up a link to or from Mattermost. You should discuss: 
* whether it is one-way or two-way
* why you are doing it, and 
* who will get access? 

This prior consultation and agreement on how the Matterbridge link will improve communications within the group will lead to a smoother introduction of the link.

### How to get a link set up

Contact [Tech Reception](https://organise.earth/uk/channels/tech-reception) on Mattermost, and ask the admins to set up your bridge. They will need the information detailed below, but they can help you with getting your end set up if you find the following instructions difficult. For non-Mattermost users, please email: [tech@rebellion.earth](mailto:tech@rebellion.earth) with your request and the info you need to supply.

### What you need to do first

1) Carefully consider security - if you link a private Mattermost channel to a Telegram channel, then the content is available to anyone who can get into the Telegram channel.
1) Get the Telegram channel or group administrator to join user "XRUKMatterbridge_bot" (our bot) to the Telegram channel or group- see instructions below. \
If it's a **channel** rather than a **group**, set the bot as Administrator - most of the admin permissions can be turned off - a Telegram->Mattermost link only needs to be able to **read** messages; a two-way link also needs to **post** messages. (NOTE: see section below for more detail).
1) Notify the [Tech Reception](https://organise.earth/uk/channels/tech-reception) or email [tech@rebellion.earth](mailto:tech@rebellion.earth) that you have added the bot to your Telegram channel, and request them to set up the Matterbridge link. Include the Telegram channel or group name, the Mattermost Team and the Mattermost Channel.

### How to add a bot to a channel on Telegram:

Desktop:
1. Open the desktop app
1. Go into the channel
1. ... menu, Manage Channel
1. Click Administrators
1. Click Add Administrator
1. Type the name of the bot ("XRUKMatterbridge_bot")
1. Click on it to add
1. Click OK to add it
1. Turn off all the permissions (or allow posts if you want a two-way link)
1. Click Save

It works the same on a phone:
1. Open the app
1. Go into the channel
1. Tap on the title bar
1. Tap administrators
1. Tap Add Admin
1. Tap the search icon
1. Type the bot name ("XRUKMatterbridge_bot")
1. Pick it from the list
1. Turn off all the rights (or allow posts if you want a two-way link)
1. Tap the tick at the top