本文整理汇总了Golang中github.com/abourget/slick.Bot.ListenFor方法的典型用法代码示例。如果您正苦于以下问题:Golang Bot.ListenFor方法的具体用法?Golang Bot.ListenFor怎么用?Golang Bot.ListenFor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/abourget/slick.Bot
的用法示例。
在下文中一共展示了Bot.ListenFor方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: InitPlugin
func (totw *Totw) InitPlugin(bot *slick.Bot) {
slick.RegisterStringList("useless techs", []string{
"http://i.minus.com/ib2bUNs2W1CI1V.gif",
"http://media.giphy.com/media/anl0wydLNhKus/giphy.gif",
"http://www.ptc.dcs.edu/Moody/comphistory/cavemanwriting.gif",
"http://i.imgur.com/VbzhAbd.gif",
"http://www.patrickcarrion.com/wp-content/uploads/2014/05/mowingdressgif.gif",
"http://cdn.shopify.com/s/files/1/0243/7593/products/MKSB023_UselessMachine_Animation_grande.gif",
"http://i.imgur.com/CRuLGek.gif",
"http://i.imgur.com/EteBF9K.gif",
"http://www.ohmagif.com/wp-content/uploads/2011/12/useless-invention.gif",
"http://i3.kym-cdn.com/photos/images/original/000/495/044/9b8.gif",
"http://uproxx.files.wordpress.com/2012/09/iron.gif",
})
slick.RegisterStringList("tech adept", []string{
"you're a real tech adept",
"what an investigator",
"such deep search!",
"a real innovator you are",
"way to go, I'm impressed",
"hope it's better than my own code",
"noted, but are you sure it's good ?",
"I'll take a look into this one",
"you're generous!",
"hurray!",
})
totw.bot = bot
go totw.ScheduleAlerts(bot.Config.GeneralChannel, time.Thursday, 16, 0)
bot.ListenFor(&slick.Conversation{
HandlerFunc: totw.ChatHandler,
})
}
示例2: InitPlugin
func (vote *Vote) InitPlugin(bot *slick.Bot) {
vote.bot = bot
bot.ListenFor(&slick.Conversation{
PublicOnly: true,
HandlerFunc: vote.voteHandler,
})
}
示例3: InitPlugin
func (standup *Standup) InitPlugin(bot *slick.Bot) {
standup.bot = bot
standup.sectionUpdates = make(chan sectionUpdate, 15)
go standup.manageUpdatesInteraction()
bot.ListenFor(&slick.Conversation{
HandlerFunc: standup.ChatHandler,
})
}
示例4: InitPlugin
func (plotberry *PlotBerry) InitPlugin(bot *slick.Bot) {
plotberry.bot = bot
plotberry.celebrated = true
plotberry.pingTime = 10 * time.Second
plotberry.totalUsers = 100001
statchan := make(chan TotalUsers, 100)
go plotberry.launchWatcher(statchan)
go plotberry.launchCounter(statchan)
bot.ListenFor(&slick.Conversation{
HandlerFunc: plotberry.ChatHandler,
})
}
示例5: InitPlugin
func (healthy *Healthy) InitPlugin(bot *slick.Bot) {
var conf struct {
HealthCheck struct {
Urls []string
}
}
bot.LoadConfig(&conf)
healthy.urls = conf.HealthCheck.Urls
bot.ListenFor(&slick.Conversation{
MentionsMeOnly: true,
ContainsAny: []string{"health", "healthy?", "health_check"},
HandlerFunc: healthy.ChatHandler,
})
}
示例6: InitPlugin
func (wicked *Wicked) InitPlugin(bot *slick.Bot) {
wicked.bot = bot
wicked.meetings = make(map[string]*Meeting)
var conf struct {
Wicked struct {
Confrooms []string `json:"conf_rooms"`
}
}
bot.LoadConfig(&conf)
for _, confroom := range conf.Wicked.Confrooms {
wicked.confRooms = append(wicked.confRooms, confroom)
}
bot.ListenFor(&slick.Conversation{
HandlerFunc: wicked.ChatHandler,
})
}
示例7: InitPlugin
func (bugger *Bugger) InitPlugin(bot *slick.Bot) {
/*
* Get an array of issues matching Filters
*/
bugger.bot = bot
var conf struct {
Github github.Conf
}
bot.LoadConfig(&conf)
bugger.ghclient = github.Client{
Conf: conf.Github,
}
bot.ListenFor(&slick.Conversation{
HandlerFunc: bugger.ChatHandler,
})
}
示例8: InitPlugin
func (dep *Deployer) InitPlugin(bot *slick.Bot) {
var conf struct {
Deployer DeployerConfig
}
bot.LoadConfig(&conf)
dep.bot = bot
dep.pubsub = pubsub.New(100)
dep.config = &conf.Deployer
dep.env = os.Getenv("PLOTLY_ENV")
if dep.env == "" {
dep.env = "debug"
}
dep.loadInternalAPI()
go dep.pubsubForwardReply()
bot.ListenFor(&slick.Conversation{
HandlerFunc: dep.ChatHandler,
MentionsMeOnly: true,
})
}