osamingo / slack-adapter

Slack adapter for the Joe bot library

Home Page:https://github.com/go-joe/joe

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Joe Bot - Slack Adapter

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


This repository contains a module for the Joe Bot library.

Getting Started

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

go get github.com/go-joe/slack-adapter

Example usage

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

package main

import (
	"github.com/go-joe/joe"
	"github.com/go-joe/slack-adapter"
)

func main() {
	b := joe.New("example-bot",
		slack.Adapter(os.Getenv("SLACK_TOKEN")),
		…
    )
	
	b.Respond("ping", Pong)

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

The adapter will emit the following events to the robot brain:

  • joe.ReceiveMessageEvent
  • joe.UserTypingEvent
  • reactions.Event

Built With

  • nlopes/slack - Slack API in Go
  • zap - Blazing fast, structured, leveled logging in Go
  • testify - A simple unit test library

Contributing

The current implementation is rather minimal and there are many more features that could be implemented on the slack 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 - fgrosse

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

Slack adapter for the Joe bot library

https://github.com/go-joe/joe

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Go 100.0%