Embiggening the exclusions list

This commit is contained in:
Chris Sexton 2013-04-21 12:37:04 -04:00
parent 9b51ce79ba
commit 543526478e
3 changed files with 11 additions and 4 deletions

View File

@ -27,7 +27,9 @@
"Joins upset the hivemind's CDO, %s.",
"%s, I WILL CUT YOU!"
],
"BadMsgs": [
"I like cron."
]
"Bad": {
"Msgs": [],
"Nicks": [],
"Hosts": []
}
}

View File

@ -27,6 +27,11 @@ type Config struct {
TwitterUserKey string
TwitterUserSecret string
BadMsgs []string
Bad struct {
Msgs []string
Nicks []string
Hosts []string
}
}
// Readconfig loads the config data out of a JSON file located in cfile

View File

@ -84,7 +84,7 @@ func (p *FirstPlugin) Message(message bot.Message) bool {
}
func (p *FirstPlugin) allowed(message bot.Message) bool {
for _, msg := range p.Bot.Config.BadMsgs {
for _, msg := range p.Bot.Config.Bad.Msgs {
if strings.ToLower(msg) == strings.ToLower(message.Body) {
log.Println("Disallowing first: ", message.User.Name, ":", message.Body)
return false