diff options
author | Georg Pfuetzenreuter | 2024-09-21 17:49:39 +0200 |
---|---|---|
committer | Georg Pfuetzenreuter | 2024-09-28 19:33:18 +0200 |
commit | cc322e87e62fa19dabfbddd937da477feb9f2516 (patch) | |
tree | b3854f2abd5b6c7d63bc25d96b2625c8481b01ae | |
parent | bde9a8defb73399e5174794d7bb20907f8716832 (diff) | |
download | watbot-cc322e87e62fa19dabfbddd937da477feb9f2516.tar.gz watbot-cc322e87e62fa19dabfbddd937da477feb9f2516.tar.bz2 watbot-cc322e87e62fa19dabfbddd937da477feb9f2516.zip |
Replace redundant logic in Admin()
The Allowed() function already implements this loop, use it to reduce
redundant code.
Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
-rw-r--r-- | wat/bot.go | 8 |
1 files changed, 1 insertions, 7 deletions
@@ -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 { |