Documentation
¶
Index ¶
- Variables
- func GetBitbucketClient(cfg config.Bitbucket) (*bitbucket.DefaultApiService, error)
- func GetChannel(identifier string) (id string, name string)
- func GetInteraction(ref msg.Ref, text string, command string, args ...string) *slack.ActionBlock
- func GetJiraClient(cfg *config.Jira) (*jira.Client, error)
- func GetSlackArchiveLink(msg msg.Ref) string
- func GetSlackLink(name string, url string, args ...string) slack.AttachmentAction
- func GetUser(identifier string) (id string, name string)
- type Slack
- func (s *Slack) AddReaction(reaction string, ref msg.Ref)
- func (s *Slack) RemoveReaction(reaction string, ref msg.Ref)
- func (s *Slack) ReplyError(ref msg.Ref, err error)
- func (s *Slack) SendMessage(ref msg.Ref, text string, options ...slack.MsgOption) string
- func (s *Slack) SendToUser(user string, text string)
- type SlackClient
Constants ¶
This section is empty.
Variables ¶
var AuthResponse slack.AuthTestResponse
AuthResponse is holding some basic Slack metadata for the current connection, like Bot-Id, Workspace etc
var Channels map[string]string
Channels is a map of each channelsId and the name
var HTTPClient = &http.Client{ Timeout: time.Second * 10, }
HTTPClient default http client for this bot to use the default go-client with a Timeout
var InternalMessages = make(chan msg.Message, 50)
InternalMessages is internal queue of internal messages
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 ¶
GetChannel returns channel-id and channel-name by an identifier which can be an id or a name
func GetInteraction ¶ added in v1.3.0
func GetJiraClient ¶
GetJiraClient created a jira client based on github.com/andygrunwald/go-jira"
func GetSlackArchiveLink ¶ added in v1.7.0
GetSlackArchiveLink returns a permalink to the ref which can be shared
func GetSlackLink ¶
func GetSlackLink(name string, url string, args ...string) slack.AttachmentAction
Types ¶
type Slack ¶
wrapper to the Slack client which also holds the RTM connection (optional) and all needed config
func GetSlackClient ¶
GetSlackClient establishes a RTM connection to the slack server
func (*Slack) SendMessage ¶
SendMessage is the "slow" reply via POST request, needed for Attachment or MsgRef
func (*Slack) SendToUser ¶
SendToUser sends a message to any user via IM channel
type SlackClient ¶
type SlackClient interface { // ReplyError Replies a error to the current channel/user/thread + log it! ReplyError(ref msg.Ref, err error) // SendMessage is the extended version of Reply and accepts any slack.MsgOption SendMessage(ref msg.Ref, text string, options ...slack.MsgOption) string // send a message to a user, using "@username or @U12334" SendToUser(user string, text string) RemoveReaction(reaction string, ref msg.Ref) AddReaction(reaction string, ref msg.Ref) GetReactions(item slack.ItemRef, params slack.GetReactionsParameters) ([]slack.ItemReaction, error) GetConversationHistory(*slack.GetConversationHistoryParameters) (*slack.GetConversationHistoryResponse, error) }