bot: log admin checks

This commit is contained in:
Chris Sexton 2022-05-30 16:53:15 -04:00
parent 1c22632a41
commit bd3ba48bbe
1 changed files with 5 additions and 1 deletions

View File

@ -249,11 +249,15 @@ func IsCmd(c *config.Config, message string) (bool, string) {
} }
func (b *bot) CheckAdmin(nick string) bool { 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 { if nick == u {
log.Info().Msg("%s admin check: passed")
return true return true
} }
} }
log.Info().Msg("%s admin check: failed")
return false return false
} }