Fix issues

This commit is contained in:
Joren 2024-07-06 21:08:44 +02:00
parent 8b001e499a
commit 00db797d65
Signed by: Joren
GPG Key ID: 280E33DFBC0F1B55

View File

@ -241,10 +241,13 @@ var (
} }
for _, roleID := range config.Discord.AdminRoles { for _, roleID := range config.Discord.AdminRoles {
err := client.ChannelPermissionSet(channel.ID, roleID, discordgo.PermissionOverwriteTypeRole, discordgo.PermissionViewChannel|discordgo.PermissionSendMessages, 0) if roleID != "" {
if err != nil { err := client.ChannelPermissionSet(channel.ID, roleID, discordgo.PermissionOverwriteTypeRole, discordgo.PermissionViewChannel|discordgo.PermissionSendMessages, 0)
log.Printf("Error setting permissions for role %s: %v", roleID, err) if err != nil {
log.Printf("Error setting permissions for role %s: %v", roleID, err)
}
} }
} }
err = client.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{ err = client.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{