Documentation ¶
Index ¶
- func BotStack(prompts []string) bot.Handler
- func BotVersion(prompt, version string) bot.Handler
- func CoinFlip(prompts []string) bot.Handler
- func Join(welcomeChannels []Channel) bot.JoinHandler
- func LinkToGoDoc(matchPrefix, urlPrefix string) bot.Handler
- func NewbieResources(prefix string) bot.Handler
- func ProcessLinear(hs ...bot.Handler) bot.Handler
- func ReactWhenContains(s string, reactions ...string) bot.Handler
- func ReactWhenContainsRand(s string, reactions ...string) bot.Handler
- func ReactWhenHasPrefix(s string, reactions ...string) bot.Handler
- func RecommendedChannels(prompt string, channels []Channel) bot.Handler
- func RespondTo(prompts []string, response string) bot.Handler
- func RespondWhenContains(s string, response string) bot.Handler
- func SearchForLibrary(prefix string) bot.Handler
- func Songs() bot.Handler
- func SuggestPlayground(h *http.Client, s *slack.Client, l bot.Logger, minLines int) bot.Handler
- func WhenDirectedToBot(h bot.Handler) bot.Handler
- func XKCD(prefix string, aliases map[string]int, logf bot.Logger) bot.Handler
- type Channel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BotStack ¶
BotStack responds to messages with information about the bot and where it runs when Message.TrimmedText contains one of prompts.
func BotVersion ¶
BotVersion responds to messages with the bot's version when Message.TrimmedText matches prompt.
func CoinFlip ¶
CoinFlip responds to messages with "heads" or "tails" when Message.TrimmedText matches one of prompts.
func Join ¶
func Join(welcomeChannels []Channel) bot.JoinHandler
Join direct messages new users with a message about the Slack team and some recommended channels.
func LinkToGoDoc ¶
LinkToGoDoc responds with to messages with matchPrefix replaced by urlPrefix.
func NewbieResources ¶
NewbieResources responds with some beginner resources when Message.TrimmedText has prefix.
If Message.TrimmedText also contains "pvt" the response will be sent as a direct message.
func ProcessLinear ¶
ProcessLinear calls handlers in order.
func ReactWhenContains ¶
ReactWhenContains adds reactions to messages that contain s.
func ReactWhenContainsRand ¶
ReactWhenContainsRand randomly calls ReactWhenContains.
Currently probability is 1/150.
func ReactWhenHasPrefix ¶
ReactWhenHasPrefix addes reactions to messages when Message.TrimmedText has prefix s.
func RecommendedChannels ¶
RecommendedChannels responds to messages a formatted list of channels when Message.TrimmedText matches prompt.
func RespondWhenContains ¶
RespondWhenContains responds to any message when that contains s.
func SearchForLibrary ¶
SearchForLibrary responds to messages with suggested places to look for a library when Message.TrimmedText has prefix.
func SuggestPlayground ¶
SuggestPlayground uploads messages/files to the playground when they have at least minLines or has files that are of type "go" or "text".
After uploading, a link will be posted to the channel and a suggestion to use the playground is sent directly to the user.
func WhenDirectedToBot ¶
WhenDirectedToBot calls h when Message.DirectedToBot is true.