Skip to content

bridge between mattermost, IRC, gitter, xmpp, slack, discord, telegram, rocket.chat,hipchat (via xmpp), steam and matrix with REST API

License

Notifications You must be signed in to change notification settings

g0v-network/matterbridge

 
 

Repository files navigation

matterbridge

Matterbridge Logo
A simple chat bridge
Letting people be where they want to be.
Bridges between a growing number of protocols. Click below to demo.

Gitter | IRC | Discord | Matrix | Slack | Mattermost | XMPP | Twitch | Zulip | And more...


Download stable Download dev Maintainability Test Coverage


Note: Mattermost isn't required to run matterbridge.

About this fork

This fork of the Matterbridge chat bridge has an additional feature that allows messages passed between chatrooms to be auto-translated into a destination language by Google Translate. This allows it to "bridge" chat rooms in the same Slack team, but bridge language communities instead of separate chat tools, which was the original intent of the tool.

For example, if there is a #general channel where Mandarin is being spoken, then someone who only spoke Japanese could create #general-ja. Messages from #general would be teleported into #general-ja after being run through Google Translate, so people in #general-ja could read along. If they reply in Japanese, their original message will be teleported back into #general untranslated, where some people will understand. But if people in #general now wish to ensure messages are actively translated into Mandarin, they can create #general-zh and move in there. Now, every message in the #general-ja channel (or any #general-XX channel, to be clear) will be auto-translated into Mandarin for readers in there.

Right now, this channel setup must happen manually via configuration file, but in theory it could be done automatically in the future, so that setting up translation is as simple as creating new Slack channels with specific naming conventions :)

Table of Contents

Features

API

The API is very basic at the moment and rather undocumented.

Used by at least 3 projects. Feel free to make a PR to add your project to this list.

Requirements

Accounts to one of the supported bridges

Screenshots

See https://github.com/42wim/matterbridge/wiki

Installing

Binaries

  • Latest stable release v1.12.1
  • Development releases (follows master) can be downloaded here

Building

Go 1.8+ is required. Make sure you have Go properly installed, including setting up your GOPATH.

After Go is setup, download matterbridge to your $GOPATH directory.

cd $GOPATH
go get github.com/42wim/matterbridge

You should now have matterbridge binary in the bin directory:

$ ls bin/
matterbridge

Configuration

Basic configuration

See howto for a step by step walkthrough for creating your configuration.

Advanced configuration

Google Translation

  • If you'd like to allow channels to be Google Translated between languages, then simply set an environment variable called GOOGLE_APPLICATION_CREDENTIALS_BASE64 to be the base64 encoded version of the JSON credentials file.

    export GOOGLE_APPLICATION_CREDENTIALS_BASE64=$(cat credentials.json | base64)
    
  • By default (in accordance with Google's terms of service), we add "[translated by Google]" to the end of all translated messages. You may customize this attribution via TranslationAttribution config key.

Examples

Bridge mattermost (off-topic) - irc (#testing)

[irc]
    [irc.freenode]
    Server="irc.freenode.net:6667"
    Nick="yourbotname"

[mattermost]
    [mattermost.work]
    Server="yourmattermostserver.tld"
    Team="yourteam"
    Login="yourlogin"
    Password="yourpass"
    PrefixMessagesWithNick=true
    RemoteNickFormat="[{PROTOCOL}] <{NICK}> "

[[gateway]]
name="mygateway"
enable=true
    [[gateway.inout]]
    account="irc.freenode"
    channel="#testing"

    [[gateway.inout]]
    account="mattermost.work"
    channel="off-topic"

Bridge slack (#general) - discord (general)

[slack]
[slack.test]
Token="yourslacktoken"
PrefixMessagesWithNick=true

[discord]
[discord.test]
Token="yourdiscordtoken"
Server="yourdiscordservername"

[general]
RemoteNickFormat="[{PROTOCOL}/{BRIDGE}] <{NICK}> "

[[gateway]]
    name = "mygateway"
    enable=true

    [[gateway.inout]]
    account = "discord.test"
    channel="general"

    [[gateway.inout]]
    account ="slack.test"
    channel = "general"

Running

See howto for a step by step walkthrough for creating your configuration.

Usage of ./matterbridge:
  -conf string
        config file (default "matterbridge.toml")
  -debug
        enable debug
  -gops
        enable gops agent
  -version
        show version

Docker

Create your matterbridge.toml file locally eg in /tmp/matterbridge.toml

docker run -ti -v /tmp/matterbridge.toml:/matterbridge.toml 42wim/matterbridge

Changelog

See changelog.md

FAQ

See FAQ

Want to tip ?

  • eth: 0xb3f9b5387c66ad6be892bcb7bbc67862f3abc16f
  • btc: 1N7cKHj5SfqBHBzDJ6kad4BzeqUBBS2zhs

Related projects

Articles

Thanks

Digitalocean for sponsoring demo/testing droplets.

Matterbridge wouldn't exist without these libraries:

About

bridge between mattermost, IRC, gitter, xmpp, slack, discord, telegram, rocket.chat,hipchat (via xmpp), steam and matrix with REST API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 99.2%
  • Other 0.8%