// GetGroupID get Slack group ID by group name func GetGroupID(api *slack.Slack, r horenso.Report, groupName string) string { group, err := api.FindGroupByName(groupName) if err != nil { panic(err) } return group.Id }
//Lookup Slack id for channel, group, or im func lookupSlackId(api *slack.Slack, name string) (string, error) { channel, err := api.FindChannelByName(name) if err == nil { return channel.Id, nil } group, err := api.FindGroupByName(name) if err == nil { return group.Id, nil } im, err := api.FindImByName(name) if err == nil { return im.Id, nil } return "", fmt.Errorf("No such channel, group, or im") }