diff --git a/wat/bot.go b/wat/bot.go index dae4e89..2e889b7 100644 --- a/wat/bot.go +++ b/wat/bot.go @@ -46,13 +46,7 @@ func (w *WatBot) HandleIrcMsg(c *irc.Client, m *irc.Message) { } func (w *WatBot) Admin(m *irc.Message) bool { - admins := w.c.AdminHosts - for _, admin := range admins { - if m.Prefix.Host == admin { - return true - } - } - return false + return w.Allowed(m.Prefix.Host, w.c.AdminHosts) } func (w *WatBot) Allowed(c string, r []string) bool {