Skip to content

Latest commit

 

History

History
 
 

usergroup

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Slack UserGroup adapter for Go Sync

This adapter synchronises email addresses with a Slack User group.

Requirements

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

Example

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)
	}
}