Documentation ¶
Index ¶
- Constants
- type Bot
- func (bot *Bot) AddAuthorizedUser(userids ...string) error
- func (bot *Bot) AddCommand(command, description string, ...)
- func (bot *Bot) AddIntervalCommand(interval time.Duration, description string, handler func(w io.Writer))
- func (bot *Bot) AddListener(pattern *regexp.Regexp, description string, ...)
- func (bot *Bot) AddReaction(msg *slk.MessageEvent, reaction string) error
- func (bot *Bot) ChannelID() string
- func (bot *Bot) IsAuthorizedUserID(id string) bool
- func (bot *Bot) Run() error
- func (bot *Bot) SendColorMessage(text, color string) error
- func (bot *Bot) SendMessage(text string) error
- func (bot *Bot) SendMessageOptions(text string, options url.Values) error
- func (bot *Bot) Stop() error
- type Command
- type IntervalCommand
- type Listener
Constants ¶
const ( ColorSuccess = "#5cb85c" ColorInfo = "#5bc0de" ColorWarning = "#f0ad4e" ColorError = "#d9534f" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bot ¶
type Bot struct { Client *slk.Client User *slk.User // either Channel or Group will be non-nil Channel *slk.Channel Group *slk.Group // contains filtered or unexported fields }
func (*Bot) AddAuthorizedUser ¶
func (*Bot) AddCommand ¶
func (*Bot) AddIntervalCommand ¶
func (*Bot) AddListener ¶
func (*Bot) AddReaction ¶
func (bot *Bot) AddReaction(msg *slk.MessageEvent, reaction string) error
func (*Bot) IsAuthorizedUserID ¶
func (*Bot) SendColorMessage ¶
func (*Bot) SendMessage ¶
func (*Bot) SendMessageOptions ¶
opt:username // My Bot // Optional // Name of bot. opt:as_user // true // Optional // Pass true to post the message as the authed user, instead of as a bot opt:parse // full // Optional // Change how messages are treated. See below. opt:link_names // 1 // Optional // Find and link channel names and usernames. opt:attachments // [{"pretext": "pre-hello", "text": "text-world"}] // Optional // Structured message attachments. opt:unfurl_links // true // Optional // Pass true to enable unfurling of primarily text-based content. opt:unfurl_media // false // Optional // Pass false to disable unfurling of media content. opt:icon_url // http://lorempixel.com/48/48 // Optional // URL to an image to use as the icon for this message opt:icon_emoji // :chart_with_upwards_trend: // Optional // emoji to use as the icon for this message. Overridesicon_url
type IntervalCommand ¶
type IntervalCommand struct {
// contains filtered or unexported fields
}