From 54e2a741c06307f1609c2a76d7401ae3d1536005 Mon Sep 17 00:00:00 2001 From: Dustin Pianalto Date: Mon, 6 Apr 2020 23:18:48 -0800 Subject: [PATCH] Test pointer panic --- utils.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/utils.go b/utils.go index 2e4c193..a0e9913 100644 --- a/utils.go +++ b/utils.go @@ -62,15 +62,15 @@ func CheckPermissions(session *discordgo.Session, member discordgo.Member, chann //} fmt.Println(role.ID) - //for _, overwrite := range channel.PermissionOverwrites { - // if overwrite.ID == roleID { - // if overwrite.Allow & int(perms) != 0 { - // return true // If the channel has an overwrite for the role then true - // } else if overwrite.Deny & int(perms) != 0 { - // return false // If there is an explicit deny then false - // } - // } - //} + for _, overwrite := range channel.PermissionOverwrites { + if overwrite.ID == roleID { + if overwrite.Allow&int(perms) != 0 { + return true // If the channel has an overwrite for the role then true + } else if overwrite.Deny&int(perms) != 0 { + return false // If there is an explicit deny then false + } + } + } if role.Permissions&int(PermissionAdministrator) != 0 { return true // If they are an administrator then they automatically have all permissions