diff --git a/pkg/controller/DiscordController.go b/pkg/controller/DiscordController.go index dcf9e1f..401ed50 100644 --- a/pkg/controller/DiscordController.go +++ b/pkg/controller/DiscordController.go @@ -204,6 +204,8 @@ func (dc *DiscordController) GetDiscordUserCard(searchString string, buttonsEnab convertData(session.BytesReceived), convertData(session.BytesSent), } + log.Debugf("Start: '%s' End: '%s' End reason: '%s' Switch name (+loc): '%s' Switch port: '%s' Assigned IP: '%s' Received: '%s' Send: '%s' ", + row[0], row[1], row[2], row[3], row[4], row[5], row[6], row[7]) table.Append(row) } @@ -215,6 +217,7 @@ func (dc *DiscordController) GetDiscordUserCard(searchString string, buttonsEnab } else { card.Content = "No session found for this user, check back once they're plugged in." } + log.Debugf("user card content: '%s'", card.Content) if !shortCard { // Available VLANs @@ -230,8 +233,10 @@ func (dc *DiscordController) GetDiscordUserCard(searchString string, buttonsEnab log.WithField("ip", switchIP.String()).Warn("Unknown switch returned from RADIUS query!") } if err != nil || switchRef == nil { + log.Debug("vlan is missing") vlansMissing = true } else { + log.Debug("crafting vlan menu") var vlanMenu []discordgo.SelectMenuOption for _, vlan := range switchRef.Vlans { isDefault := switchRef.PrimaryVlan == vlan diff --git a/pkg/discord/Commands.go b/pkg/discord/Commands.go index dec36a5..5925ffb 100644 --- a/pkg/discord/Commands.go +++ b/pkg/discord/Commands.go @@ -189,6 +189,10 @@ func (d *Discord) handleUserSubcommand(s *discordgo.Session, i *discordgo.Intera } d.macCache[i.Interaction.ID] = userCard.RealMAC + log.Debugf("user card content: '%s'", userCard.Content) + log.Debugf("user card components: '%v'", userCard.Components) + log.Debugf("user card embeds: '%v'", userCard.Embeds) + err = s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{ Type: discordgo.InteractionResponseChannelMessageWithSource, Data: &discordgo.InteractionResponseData{