From 81f7d3ccdc8c12bdccdba32fd9204dbe69b87d00 Mon Sep 17 00:00:00 2001 From: Gregory Rudolph Date: Wed, 5 May 2021 23:13:32 -0400 Subject: [PATCH] Cleanup admin check --- discordMessage.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/discordMessage.go b/discordMessage.go index a56d2c2..d73ffd2 100644 --- a/discordMessage.go +++ b/discordMessage.go @@ -31,10 +31,8 @@ func messageCreate(s *discordgo.Session, m *discordgo.MessageCreate) { } return } - for role := range m.Member.Roles { - if fmt.Sprintf("%+v", role) == config.AdminRole { - adminInteraction(s, m.Author.ID) - } + if isAdmin(m.Member) { + adminInteraction(s, m.Author.ID) } if m.ChannelID != config.AdminChannel { lastActiveChan = m.ChannelID