diff --git a/bot/bot.go b/bot/bot.go index 9a6bef6..29c0bf2 100644 --- a/bot/bot.go +++ b/bot/bot.go @@ -94,6 +94,7 @@ type Message struct { Command bool Action bool Time time.Time + Host string } type Variable struct { diff --git a/bot/handlers.go b/bot/handlers.go index c1f092b..6d3f2e2 100644 --- a/bot/handlers.go +++ b/bot/handlers.go @@ -136,6 +136,7 @@ func (b *Bot) buildMessage(conn *irc.Conn, line *irc.Line) Message { Command: iscmd, Action: isaction, Time: time.Now(), + Host: line.Host, } return msg diff --git a/plugins/first.go b/plugins/first.go index d41e165..8345009 100644 --- a/plugins/first.go +++ b/plugins/first.go @@ -90,6 +90,18 @@ func (p *FirstPlugin) allowed(message bot.Message) bool { return false } } + for _, host := range p.Bot.Config.Bad.Hosts { + if host == message.Host { + log.Println("Disallowing first: ", message.User.Name, ":", message.Body) + return false + } + } + for _, nick := range p.Bot.Config.Bad.Nicks { + if nick == message.User.Name { + log.Println("Disallowing first: ", message.User.Name, ":", message.Body) + return false + } + } return true }