refactor: group list - add more info #29

Merged
Kichiyaki merged 1 commits from refactor/group-list-description into master 2022-10-28 03:20:39 +00:00

View File

@ -489,9 +489,24 @@ func (c *groupCommand) handleDelete(s *discordgo.Session, i *discordgo.Interacti
}
func buildGroupListDescription(groups []domain.Group) string {
description := "**ID** - **Version** - **Server**"
description := "**ID** - **Server** - **Channel gains** - **Channel losses**"
for i, g := range groups {
description += fmt.Sprintf("\n%d. %s - %s - %s", i+1, g.ID, g.VersionCode, g.ServerKey)
channelGains := "Not set"
if g.ChannelGains != "" {
channelGains = "<#" + g.ChannelGains + ">"
}
channelLosses := "Not set"
if g.ChannelLosses != "" {
channelLosses = "<#" + g.ChannelLosses + ">"
}
description += fmt.Sprintf(
"\n%d. %s - %s - %s - %s",
i+1,
g.ID,
g.ServerKey,
channelGains,
channelLosses,
)
}
return description
}