mattermost2discord
![Go Report Card](https://goreportcard.com/badge/github.com/ClubCedille/mattermost2discord)
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 Mattermost2Discord](https://www.plantuml.com/plantuml/svg/ZPGzRzim48Pt_We27Z9bQ9OYHX54YM0WW9qQKOeEROUpTAO9YwH2dk2wHVzxZx9aqwuGr8Cat3ryxvE-3mIUMbFB1H2XDoxGJQv3wNmbn5MkGNamadrUhrh28C9MsmQYCT2-HdvwNKQ5n5FWMuksn0M600gpMYjhq98i-O4-rUX9-Lj8_cNUkzsZgvsNEM9JRFSFTOi7LqdEFt1QwCU1kLxZN5jCcTK_JYYtohlMLWTWajtcZ_bCTD2IMw5BtO2bzmAbs8LSxYg5VeoSEKlFO50-cGPA6dCN-XVA3n_7N7soNJb9DowYmriB9-_ft6WhBoCUZLsM6JJuK_mH0g9PVWd8yk7mddpTQCB2k2sA9CzaWoAwMCZ9NAiD5OHOTx5Js9YRYjSiaiFdUtY_aX6l-izBN5mznUNYXBMpuRXPGMehkscA8T3rjqdVZX_NTp7HgSnse2d8DTUw_5oyIXzF1n9TmGdVusmEaXTVyRJbBjuLDfzXGwmfNmPRXNFLmVc9ZxouFTIfzWi2ypqgLwxQYpZaHYwzutA2jkhS6wStNjefYMGst-qhJyxo6rhQy8NKQrr2RDf_ASsSDqnp4cUQRMoKETntmHMFDVlkEBifTte7dkliZt0pNQisB3GWAqVYdeNud-Kl)
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](https://github.com/ClubCedille/mattermost2discord/raw/v1.0.8/img/mattermostWebHook.png)
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 :
- DISCORD_TOKEN : Discord bot token
- MATTERMOST_TOKEN : Mattermost Webhook token
- DISCORD_CHANNEL : Discord Channel ID which will foward messages
- TRIGGER_WORD_MATTERMOST : Trigger word to foward your message from mattermost to discord.
- PORT: The port on which the server will listen