Documentation ¶
Index ¶
- type Channel
- type SlackService
- func (s *SlackService) CreateMessage(message slack.Message) []string
- func (s *SlackService) CreateMessageFromMessageEvent(message *slack.MessageEvent) []string
- func (s *SlackService) GetChannels() []Channel
- func (s *SlackService) GetMessages(channel interface{}, count int) []string
- func (s *SlackService) SendMessage(channel string, message string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SlackService ¶
type SlackService struct { Client *slack.Client RTM *slack.RTM SlackChannels []interface{} Channels []Channel UserCache map[string]string CurrentUserID string }
func NewSlackService ¶
func NewSlackService(token string) *SlackService
NewSlackService is the constructor for the SlackService and will initialize the RTM and a Client
func (*SlackService) CreateMessage ¶
func (s *SlackService) CreateMessage(message slack.Message) []string
CreateMessage will create a string formatted message that can be rendered in the Chat pane.
[23:59] <erroneousboat> Hello world!
This returns an array of string because we will try to uncover attachments associated with messages.
func (*SlackService) CreateMessageFromMessageEvent ¶
func (s *SlackService) CreateMessageFromMessageEvent(message *slack.MessageEvent) []string
func (*SlackService) GetChannels ¶
func (s *SlackService) GetChannels() []Channel
GetChannels will retrieve all available channels, groups, and im channels. Because the channels are of different types, we will append them to an []interface as well as to a []Channel which will give us easy access to the id and name of the Channel.
func (*SlackService) GetMessages ¶
func (s *SlackService) GetMessages(channel interface{}, count int) []string
func (*SlackService) SendMessage ¶
func (s *SlackService) SendMessage(channel string, message string)
Click to show internal directories.
Click to hide internal directories.