refactor: group list - add more info #29
|
@ -489,9 +489,24 @@ func (c *groupCommand) handleDelete(s *discordgo.Session, i *discordgo.Interacti
|
||||||
}
|
}
|
||||||
|
|
||||||
func buildGroupListDescription(groups []domain.Group) string {
|
func buildGroupListDescription(groups []domain.Group) string {
|
||||||
description := "**ID** - **Version** - **Server**"
|
description := "**ID** - **Server** - **Channel gains** - **Channel losses**"
|
||||||
for i, g := range groups {
|
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
|
return description
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user