Skip to content
This repository has been archived by the owner on Jul 11, 2022. It is now read-only.

dwmunster/joe-mattermost-adapter

Repository files navigation

Joe Bot - Mattermost Adapter

Connecting joe with the Mattermost chat application. https://github.com/go-joe/joe


This repository contains a module for the Joe Bot library.

THIS SOFTWARE IS STILL IN ALPHA AND THERE ARE NO GUARANTEES REGARDING API STABILITY YET.

Getting Started

This library is packaged using the new Go modules. You can get it via:

go get github.com/dwmunster/joe-mattermost-adapter

Example usage

In order to connect your bot to mattermost you can simply pass it as module when creating a new bot:

package main

import (
	"os"

	"github.com/dwmunster/joe-mattermost-adapter"
	"github.com/go-joe/joe"
)

func main() {
	b := joe.New("example-bot",
        mattermost.Adapter(
            os.Getenv("MATTERMOST_TOKEN"),
            os.Getenv("MATTERMOST_URL"),
            os.Getenv("MATTERMOST_TEAM"),
        ),
	)
	b.Respond("ping", Pong)

	err := b.Run()
	if err != nil {
		b.Logger.Fatal(err.Error())
	}
}

func Pong(msg joe.Message) error {
	return msg.RespondE("PONG")
}

So far the adapter will emit the following events to the robot brain:

  • joe.ReceiveMessageEvent

Built With

Contributing

The current implementation is rather minimal and there are many more features that could be implemented on the mattermost adapter so you are highly encouraged to contribute. If you want to hack on this repository, please read the short CONTRIBUTING.md guide first.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

  • Friedrich Große - Initial work on Slack adapter - fgrosse
  • Drayton Munster - Conversion to Mattermost API - dwmunster

See also the list of contributors who participated in this project.

License

This project is licensed under the BSD-3-Clause License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages