func (res *GroupsListAPIResponse) Groups() ([]*Group, error) {
	var groups []*Group
	err := json.Unmarshal(res.RawGroups, &groups)
	if err != nil {
		return nil, err
	}
	return groups, nil
}
Groups returns a slice of group object from `groups.list` api.
package slack
import (
	"encoding/json"
	"errors"
)
func (sl *Slack) GroupsList() ([]*Group, error) {
	uv := sl.urlValues()
	body, err := sl.GetRequest(groupsListApiEndpoint, uv)
	if err != nil {
		return nil, err
	}
	res := new(GroupsListAPIResponse)
	err = json.Unmarshal(body, res)
	if err != nil {
		return nil, err
	}
	if !res.Ok {
		return nil, errors.New(res.Error)
	}
	return res.Groups()
}
func (sl *Slack) CreateGroup(name string) error {
	uv := sl.urlValues()
	uv.Add("name", name)
	_, err := sl.GetRequest(groupsCreateApiEndpoint, uv)
	if err != nil {
		return err
	}
	return nil
}
type Group struct {
	Id         string          `json:"id"`
	Name       string          `json:"name"`
	Created    int             `json:"created"`
	Creator    string          `json:"creator"`
	IsArchived bool            `json:"is_archived"`
	Members    []string        `json:"members"`
	RawTopic   json.RawMessage `json:"topic"`
	RawPurpose json.RawMessage `json:"purpose"`
}
type GroupsListAPIResponse struct {
	BaseAPIResponse
	RawGroups json.RawMessage `json:"groups"`
}