From bd3ba48bbec61e24edf6adbacca4247bd96f8e29 Mon Sep 17 00:00:00 2001 From: Chris Sexton <3216719+chrissexton@users.noreply.github.com> Date: Mon, 30 May 2022 16:53:15 -0400 Subject: [PATCH] bot: log admin checks --- bot/bot.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bot/bot.go b/bot/bot.go index b43995f..66e02fa 100644 --- a/bot/bot.go +++ b/bot/bot.go @@ -249,11 +249,15 @@ func IsCmd(c *config.Config, message string) (bool, string) { } func (b *bot) CheckAdmin(nick string) bool { - for _, u := range b.Config().GetArray("Admins", []string{}) { + admins := b.Config().GetArray("Admins", []string{}) + log.Info().Interface("admins", admins).Msgf("Checking admin for %s", nick) + for _, u := range admins { if nick == u { + log.Info().Msg("%s admin check: passed") return true } } + log.Info().Msg("%s admin check: failed") return false }