From 543526478e7e91d5f89795b98a1e2e16f7438b7f Mon Sep 17 00:00:00 2001 From: Chris Sexton Date: Sun, 21 Apr 2013 12:37:04 -0400 Subject: [PATCH] Embiggening the exclusions list --- config.json | 8 +++++--- config/config.go | 5 +++++ plugins/first.go | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) 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