beers: add dynamic drinking word feature

This commit is contained in:
Chris Sexton 2021-02-01 15:18:36 -05:00 committed by Chris Sexton
parent 41a757cd8b
commit 2b47654302
1 changed files with 2 additions and 1 deletions

View File

@ -154,7 +154,8 @@ func (p *BeersPlugin) register() {
return true return true
}}, }},
{Kind: bot.Message, IsCmd: true, {Kind: bot.Message, IsCmd: true,
Regex: regexp.MustCompile(`(?i)^imbibe$`), Regex: regexp.MustCompile(`(?i)^` +
strings.Join(p.c.GetArray("beers.imbibewords", []string{"imbibe", "quaff"}), "|") + `$`),
Handler: func(r bot.Request) bool { Handler: func(r bot.Request) bool {
p.addBeers(r.Msg.User.Name, 1) p.addBeers(r.Msg.User.Name, 1)
p.randomReply(r.Conn, r.Msg.Channel) p.randomReply(r.Conn, r.Msg.Channel)