This adapter synchronises email addresses with a Slack User group.
In order to synchronise with Slack, you'll need to create a Slack app with the following OAuth permissions:
Bot Token Scopes |
---|
users:read |
users:read.email |
usergroups:read |
usergroups:write |
package main
import (
"context"
"log"
"github.com/ovotech/go-sync"
"github.com/ovotech/go-sync/adapters/slack/usergroup"
"github.com/slack-go/slack"
)
func main() {
slackClient := slack.New("my-slack-token")
userGroupAdapter := usergroup.New(slackClient, "UG000123")
svc := gosync.New(userGroupAdapter)
// Synchronise a Slack User group with something else.
anotherServiceAdapter := someAdapter.New()
err := svc.SyncWith(context.Background(), anotherServiceAdapter)
if err != nil {
log.Fatal(err)
}
}