mattermost2discord

command module
v1.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2021 License: GPL-3.0 Imports: 3 Imported by: 0

README

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 :

  • 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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL