feat: enable/disable notifications of internal/barbarian conquers
All checks were successful
continuous-integration/drone/pr Build is passing
All checks were successful
continuous-integration/drone/pr Build is passing
This commit is contained in:
parent
02141fb6e8
commit
4f1f332ddb
|
@ -624,7 +624,7 @@ func (c *groupCommand) handleDelete(s *discordgo.Session, i *discordgo.Interacti
|
|||
}
|
||||
|
||||
func buildGroupListDescription(groups []domain.Group) string {
|
||||
description := "**ID** - **Server** - **Channel gains** - **Channel losses**"
|
||||
description := "**ID** - **Server** - **Channel gains** - **Channel losses** - **Internals** - **Barbarians**"
|
||||
for i, g := range groups {
|
||||
channelGains := "Not set"
|
||||
if g.ChannelGains != "" {
|
||||
|
@ -635,12 +635,14 @@ func buildGroupListDescription(groups []domain.Group) string {
|
|||
channelLosses = "<#" + g.ChannelLosses + ">"
|
||||
}
|
||||
description += fmt.Sprintf(
|
||||
"\n%d. %s - %s - %s - %s",
|
||||
"\n%d. %s - %s - %s - %s - %s - %s",
|
||||
i+1,
|
||||
g.ID,
|
||||
g.ServerKey,
|
||||
channelGains,
|
||||
channelLosses,
|
||||
boolToEmoji(g.Internals),
|
||||
boolToEmoji(g.Barbarians),
|
||||
)
|
||||
}
|
||||
return description
|
||||
|
|
|
@ -30,3 +30,10 @@ func buildLink(text string, url string) string {
|
|||
}
|
||||
return fmt.Sprintf("[`%s`](%s)", text, url)
|
||||
}
|
||||
|
||||
func boolToEmoji(val bool) string {
|
||||
if val {
|
||||
return ":white_check_mark:"
|
||||
}
|
||||
return ":x:"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user