Documentation
¶
Index ¶
- Variables
- func GetBitbucketClient(cfg config.Bitbucket) (*bitbucket.DefaultApiService, error)
- func GetChannel(identifier string) (id string, name string)
- func GetInteraction(event slack.MessageEvent, text string, command string, args ...string) *slack.ActionBlock
- func GetJiraClient(cfg config.Jira) (*jira.Client, error)
- func GetSlackLink(name string, url string, args ...string) slack.AttachmentAction
- func GetUser(identifier string) (id string, name string)
- type Slack
- func (s Slack) AddReaction(name string, item slack.ItemRef)
- func (s Slack) RemoveReaction(name string, item slack.ItemRef)
- func (s Slack) Reply(event slack.MessageEvent, text string, options ...slack.MsgOption)
- func (s Slack) ReplyError(event slack.MessageEvent, err error)
- func (s Slack) SendMessage(event slack.MessageEvent, text string, options ...slack.MsgOption) string
- func (s Slack) SendToUser(user string, text string) string
- type SlackClient
Constants ¶
This section is empty.
Variables ¶
View Source
var BotUserID = ""
BotUserID is filled with the slack user id of the bot
View Source
var Channels map[string]string
Channels is a map of each channelsId and the name
View Source
var InternalMessages = make(chan slack.MessageEvent, 50)
InternalMessages is internal queue of internal messages
View Source
var Users map[string]string
Users is a lookup from user-id to user-name
Functions ¶
func GetBitbucketClient ¶ added in v1.6.0
func GetBitbucketClient(cfg config.Bitbucket) (*bitbucket.DefaultApiService, error)
GetBitbucketClient initialized a API client based on the given config
func GetChannel ¶
func GetInteraction ¶ added in v1.3.0
func GetInteraction(event slack.MessageEvent, text string, command string, args ...string) *slack.ActionBlock
func GetJiraClient ¶
GetJiraClient created a jira client based on github.com/andygrunwald/go-jira"
func GetSlackLink ¶
func GetSlackLink(name string, url string, args ...string) slack.AttachmentAction
Types ¶
type Slack ¶
func GetSlackClient ¶
GetSlackClient establishes a RTM connection to the slack server
func (Slack) ReplyError ¶
func (s Slack) ReplyError(event slack.MessageEvent, err error)
func (Slack) SendMessage ¶
func (s Slack) SendMessage(event slack.MessageEvent, text string, options ...slack.MsgOption) string
SendMessage is the "slow" reply via POST request, needed for Attachment or MsgRef
type SlackClient ¶
type SlackClient interface {
// Reply a message to the current channel/user/thread
Reply(event slack.MessageEvent, text string, options ...slack.MsgOption)
// ReplyError Replies a error to the current channel/user/thread + log it!
ReplyError(event slack.MessageEvent, err error)
// SendMessage is the extended version of Reply and accepts any slack.MsgOption
SendMessage(event slack.MessageEvent, text string, options ...slack.MsgOption) string
SendToUser(user string, text string) string
RemoveReaction(name string, item slack.ItemRef)
AddReaction(name string, item slack.ItemRef)
GetReactions(item slack.ItemRef, params slack.GetReactionsParameters) ([]slack.ItemReaction, error)
}
Click to show internal directories.
Click to hide internal directories.