From 2a42301c25e4a928a73bd2cfc9cab3e858fd14be Mon Sep 17 00:00:00 2001 From: Joren Date: Sat, 6 Jul 2024 20:44:16 +0200 Subject: [PATCH] Tabs --- main.go | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/main.go b/main.go index 2110035..b496cf4 100644 --- a/main.go +++ b/main.go @@ -21,9 +21,9 @@ var ( ) type Config struct { - Discord Discord `toml:"discord"` - Database Database `toml:"database"` - AdminRoles []string `toml:"admin_roles"` + Discord Discord `toml:"discord"` + Database Database `toml:"database"` + AdminRoles []string `toml:"admin_roles"` } type Discord struct { @@ -108,12 +108,11 @@ func getUsernameFromMember(member *discordgo.Member) string { } else if member.User != nil && member.User.Username != "" { userName = member.User.Username } else { - userName = "UnknownUser" + userName = "UnknownUser" } return userName } - var ( commands = []discordgo.ApplicationCommand{ { @@ -230,9 +229,9 @@ var ( ParentID: categoryID, PermissionOverwrites: []*discordgo.PermissionOverwrite{ { - ID: guildID, - Type: discordgo.PermissionOverwriteTypeRole, - Deny: discordgo.PermissionViewChannel, + ID: guildID, + Type: discordgo.PermissionOverwriteTypeRole, + Deny: discordgo.PermissionViewChannel, }, }, }) @@ -375,10 +374,10 @@ func canCreateTicket(userName, softwareType string) bool { } for _, channel := range guildChannels { - if channel.Type == discordgo.ChannelTypeGuildText && channel.ParentID == config.Discord.CategoryID { + if channel.Type == discordgo.ChannelTypeGuildText && channel.ParentID == config.Discord.CategoryID { expectedName := fmt.Sprintf("reset-%s-%s", softwareType, userName) if channel.Name == expectedName { - return false + return false } } } @@ -441,4 +440,3 @@ func main() { db.Close() } } -