Documentation ¶
Index ¶
Constants ¶
const Version = "0.0.1"
Version is the current version of the Slack Bot.
Variables ¶
var ActiveCommands = []Command{ GopherNewbieResourcesCommand, GopherRecommendedChannelsCommand, GopherDatabaseTutorialCommand, GopherPackageLayoutCommand, GopherLibraryForCommand, VersionCommand, VersionBotCommand, }
ActiveCommands the commands that are enabled and ready to being used.
var GopherDatabaseTutorialCommand = Command{ Name: "database tutorial", Description: "tutorial about using sql databases", Handler: func(bot *Slack, c hanu.ConversationInterface) { c.Reply(gopherDatabaseTutorialReply) }, }
GopherDatabaseTutorialCommand shows tuts about sql databases.
var GopherLibraryForCommand = Command{ Name: "library for <name>", Description: "learn how to structure your Go package", Handler: func(bot *Slack, c hanu.ConversationInterface) { name, err := c.String("name") if err != nil { c.Reply("miss <name> ?") return } c.Reply(gopherLibraryForDynamicReply(name)) }, }
GopherLibraryForCommand search a go package that matches <name>.
var GopherNewbieResourcesCommand = Command{ Name: "newbie resources", Description: "get a list of newbie resources", Handler: func(bot *Slack, c hanu.ConversationInterface) { c.Reply(gopherNewbieResourcesReply) }, }
GopherNewbieResourcesCommand shows the newbie resources.
var GopherPackageLayoutCommand = Command{ Name: "package layout", Description: "learn how to structure your Go package", Handler: func(bot *Slack, c hanu.ConversationInterface) { c.Reply(gopherDatabaseTutorialReply) }, }
GopherPackageLayoutCommand shows how to structure your Go package.
var GopherRecommendedChannelsCommand = Command{ Name: "recommended channels", Description: "get a list of recommended channels", Handler: func(bot *Slack, c hanu.ConversationInterface) { c.Reply(gopherRecommendedChannelsReply) }, }
GopherRecommendedChannelsCommand shows the recommended channels.
var VersionBotCommand = Command{ Name: "version bot", Description: "outputs the bot's current version", Handler: func(bot *Slack, c hanu.ConversationInterface) { c.Reply("bot's current version is: " + Version) }, }
VersionBotCommand "version bot" shows the bot's current version.
var VersionCommand = Command{ Name: "version", Description: "outputs the ion's current version", Handler: func(bot *Slack, c hanu.ConversationInterface) { c.Reply("ion's current version is: " + ion.Version) }, }
VersionCommand "version" shows the ion's current version.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct { Name string // hello Description string Args string // <word> Handler Handler }
A Command describes a bot's command.
It's "Name" and "Handler" are required.
type Handler ¶
type Handler func(bot *Slack, c hanu.ConversationInterface)
Handler is the handler signature for a Command.
type Slack ¶
type Slack struct {
// contains filtered or unexported fields
}
A Slack describes our slack integration bot service.
func (*Slack) RegisterCommand ¶
RegisterCommand registers a Command to the underline bot service.
Should be called before `Listen`.