From 00db797d65d73b82ce678b7b258e1e6af78f9c60 Mon Sep 17 00:00:00 2001 From: Joren Date: Sat, 6 Jul 2024 21:08:44 +0200 Subject: [PATCH] Fix issues --- main.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index aa3e118..c91e893 100644 --- a/main.go +++ b/main.go @@ -241,10 +241,13 @@ var ( } for _, roleID := range config.Discord.AdminRoles { - err := client.ChannelPermissionSet(channel.ID, roleID, discordgo.PermissionOverwriteTypeRole, discordgo.PermissionViewChannel|discordgo.PermissionSendMessages, 0) - if err != nil { - log.Printf("Error setting permissions for role %s: %v", roleID, err) + if roleID != "" { + err := client.ChannelPermissionSet(channel.ID, roleID, discordgo.PermissionOverwriteTypeRole, discordgo.PermissionViewChannel|discordgo.PermissionSendMessages, 0) + if err != nil { + log.Printf("Error setting permissions for role %s: %v", roleID, err) + } } + } err = client.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{