ClubCedille / mattermost2discord

Forward messages from Mattermost to Discord.
GNU General Public License v3.0
4 stars 0 forks source link

mattermost2discord

Go Report Card

REST API that forwards messages from Mattermost to Discord, using a callback.

Depencencies

Usage

With Kubernetes

To use mattermost2discord with Kubernetes, simply declare a kustomization.yml configuration file like so:

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- https://github.com/ClubCedille/mattermost2discord?ref=v1.0.0 # Example release

Then, you can build your kustomize configuration like this:

$ kustomize build
...

Development

Running the API - using Docker

To run the API, you can use the following command:

$ make docker
...

The service will then run on the port 3000.

Running the API - without Docker

You can also run the API without Docker, but make sure the PORT environment variable is set on your machine to something like 3000 or any other port available on your computer. You can run it with the following command:

$ make run
...

Running the tests

To run the tests, simply execute this command:

$ make test
...

Git hooks

To share the same versioned across the team, execute this command:

$ git config core.hooksPath .githooks

Configuration

Mattermost2Discord

1. Webhook set up

Set up an outgoing webhook from mattermost with a specified channel that delivers the payload to your web service with the following option selected :

Mattermost webhook Config

Keep the token generated by the creation of the webhook.

2. Set up Discord bot

Create your discord bot, invite it to your server and keep the token provided.

3. Set up environnement variables

Set all of the following env variables :