Enabling new stuff

This commit is contained in:
Chris Sexton 2013-04-21 16:49:00 -04:00
parent 543526478e
commit cc58de580a
3 changed files with 14 additions and 0 deletions

View File

@ -94,6 +94,7 @@ type Message struct {
Command bool Command bool
Action bool Action bool
Time time.Time Time time.Time
Host string
} }
type Variable struct { type Variable struct {

View File

@ -136,6 +136,7 @@ func (b *Bot) buildMessage(conn *irc.Conn, line *irc.Line) Message {
Command: iscmd, Command: iscmd,
Action: isaction, Action: isaction,
Time: time.Now(), Time: time.Now(),
Host: line.Host,
} }
return msg return msg

View File

@ -90,6 +90,18 @@ func (p *FirstPlugin) allowed(message bot.Message) bool {
return false 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 return true
} }