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 {
|
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 {
|
for i, g := range groups {
|
||||||
channelGains := "Not set"
|
channelGains := "Not set"
|
||||||
if g.ChannelGains != "" {
|
if g.ChannelGains != "" {
|
||||||
|
@ -635,12 +635,14 @@ func buildGroupListDescription(groups []domain.Group) string {
|
||||||
channelLosses = "<#" + g.ChannelLosses + ">"
|
channelLosses = "<#" + g.ChannelLosses + ">"
|
||||||
}
|
}
|
||||||
description += fmt.Sprintf(
|
description += fmt.Sprintf(
|
||||||
"\n%d. %s - %s - %s - %s",
|
"\n%d. %s - %s - %s - %s - %s - %s",
|
||||||
i+1,
|
i+1,
|
||||||
g.ID,
|
g.ID,
|
||||||
g.ServerKey,
|
g.ServerKey,
|
||||||
channelGains,
|
channelGains,
|
||||||
channelLosses,
|
channelLosses,
|
||||||
|
boolToEmoji(g.Internals),
|
||||||
|
boolToEmoji(g.Barbarians),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
return description
|
return description
|
||||||
|
|
|
@ -30,3 +30,10 @@ func buildLink(text string, url string) string {
|
||||||
}
|
}
|
||||||
return fmt.Sprintf("[`%s`](%s)", text, url)
|
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