diff --git a/config.json b/config.json index 62538ae..54aceff 100644 --- a/config.json +++ b/config.json @@ -27,7 +27,9 @@ "Joins upset the hivemind's CDO, %s.", "%s, I WILL CUT YOU!" ], - "BadMsgs": [ - "I like cron." - ] + "Bad": { + "Msgs": [], + "Nicks": [], + "Hosts": [] + } } diff --git a/config/config.go b/config/config.go index 53f88aa..43bd9f4 100644 --- a/config/config.go +++ b/config/config.go @@ -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 diff --git a/plugins/first.go b/plugins/first.go index 495aee8..d41e165 100644 --- a/plugins/first.go +++ b/plugins/first.go @@ -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