diff --git a/cron/handler.go b/cron/handler.go index 73fc81c..4016812 100644 --- a/cron/handler.go +++ b/cron/handler.go @@ -148,6 +148,7 @@ func (h *handler) checkEnnoblements() { (!group.ShowEnnobledBarbarians && isBarbarian) { continue } + newMsgDataConfig := newMessageConfig{ host: langVersion.Host, server: observation.Server, @@ -175,6 +176,7 @@ func (h *handler) checkEnnoblements() { SetTimestamp(formatDateOfConquest(time.Now())). MessageEmbed) } + if group.LostVillagesChannelID != "" && !lostVillagesMsg.IsEmpty() { h.discord.SendEmbed(group.LostVillagesChannelID, discord. diff --git a/discord/admin_commands.go b/discord/admin_commands.go index 8c214a9..1e4d733 100644 --- a/discord/admin_commands.go +++ b/discord/admin_commands.go @@ -185,7 +185,7 @@ func (s *Session) handleConqueredVillagesCommand(ctx commandCtx, m *discordgo.Me m.Author.Mention()+" "+ctx.localizer.MustLocalize(&i18n.LocalizeConfig{ MessageID: "help.conqueredvillages", DefaultMessage: message.FallbackMsg("help.conqueredvillages", - "**{{.Command}}** [group id from {{.GroupsCommand}}] - changes the channel on which notifications about conquered village will show. **IMPORTANT!** Call this command on the channel you want to display these notifications."), + "**{{.Command}}** [group id from {{.GroupsCommand}}] - changes the channel on which notifications about conquered village will show. **IMPORTANT!** Run this command on the channel you want to display these notifications."), TemplateData: map[string]interface{}{ "Command": ConqueredVillagesCommand.WithPrefix(s.cfg.CommandPrefix), "GroupsCommand": GroupsCommand.WithPrefix(s.cfg.CommandPrefix), @@ -321,7 +321,7 @@ func (s *Session) handleLostVillagesCommand(ctx commandCtx, m *discordgo.Message m.Author.Mention()+" "+ctx.localizer.MustLocalize(&i18n.LocalizeConfig{ MessageID: "help.lostvillages", DefaultMessage: message.FallbackMsg("help.lostvillages", - "**{{.Command}}** [group id from {{.GroupsCommand}}] changes the channel on which notifications about lost village will show. **IMPORTANT!** Call this command on the channel you want to display these notifications."), + "**{{.Command}}** [group id from {{.GroupsCommand}}] changes the channel on which notifications about lost village will show. **IMPORTANT!** Run this command on the channel you want to display these notifications."), TemplateData: map[string]interface{}{ "Command": LostVillagesCommand.WithPrefix(s.cfg.CommandPrefix), "GroupsCommand": GroupsCommand.WithPrefix(s.cfg.CommandPrefix), @@ -778,8 +778,8 @@ func (s *Session) handleObservationsCommand(ctx commandCtx, m *discordgo.Message }) msg := &EmbedMessage{} - if len(observations) <= 0 { - msg.Append("Brak") + if len(observations) <= 0 || err != nil || langVersionList != nil { + msg.Append("-") } else { for i, observation := range observations { tag := "Unknown" diff --git a/discord/public_commands.go b/discord/public_commands.go index b674b1f..9f10f8b 100644 --- a/discord/public_commands.go +++ b/discord/public_commands.go @@ -439,7 +439,7 @@ func (s *Session) handleTribeCommand(ctx commandCtx, m *discordgo.MessageCreate, SetFields(msg.ToMessageEmbedFields()). SetFooter(ctx.localizer.MustLocalize(&i18n.LocalizeConfig{ MessageID: "pagination.labelDisplayedPage", - DefaultMessage: message.FallbackMsg("pagination.labelDisplayedPage", "{{.Page}} from {{.MaxPage}}"), + DefaultMessage: message.FallbackMsg("pagination.labelDisplayedPage", "{{.Page}} of {{.MaxPage}}"), TemplateData: map[string]interface{}{ "Page": page, "MaxPage": totalPages, diff --git a/go.mod b/go.mod index 4172af9..c3f0bbd 100644 --- a/go.mod +++ b/go.mod @@ -10,8 +10,8 @@ require ( github.com/pkg/errors v0.9.1 github.com/robfig/cron/v3 v3.0.1 github.com/segmentio/encoding v0.1.14 // indirect - github.com/tribalwarshelp/golang-sdk v0.0.0-20200709112050-ba3a7ba145b1 - github.com/tribalwarshelp/shared v0.0.0-20200707075151-722e4a520a3c + github.com/tribalwarshelp/golang-sdk v0.0.0-20200721095058-9ee3513a54a9 + github.com/tribalwarshelp/shared v0.0.0-20200721094728-9ea33a732990 golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1 // indirect golang.org/x/text v0.3.2 ) diff --git a/go.sum b/go.sum index 3d4d9b7..c180300 100644 --- a/go.sum +++ b/go.sum @@ -105,10 +105,10 @@ github.com/stretchr/testify v1.6.0 h1:jlIyCplCJFULU/01vCkhKuTyc3OorI3bJFuw6obfgh github.com/stretchr/testify v1.6.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc h1:9lRDQMhESg+zvGYmW5DyG0UqvY96Bu5QYsTLvCHdrgo= github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc/go.mod h1:bciPuU6GHm1iF1pBvUfxfsH0Wmnc2VbpgvbI9ZWuIRs= -github.com/tribalwarshelp/golang-sdk v0.0.0-20200709112050-ba3a7ba145b1 h1:p+/OHcQQYXCmxjG+YTkXfeL4Oxku7t6sW0KK2Ne85V4= -github.com/tribalwarshelp/golang-sdk v0.0.0-20200709112050-ba3a7ba145b1/go.mod h1:jQWbuz96EMQTuxhanSY1imtK4zEjPrB1cM5wCKkk7l4= -github.com/tribalwarshelp/shared v0.0.0-20200707075151-722e4a520a3c h1:wenSReGHPux51q5s+9Ji0TOHCt8Zx6whxsjx8Iv7aZg= -github.com/tribalwarshelp/shared v0.0.0-20200707075151-722e4a520a3c/go.mod h1:tf+2yTHasV6jAF3V2deZ9slNoCyBzC0fMdTjI7clf6Y= +github.com/tribalwarshelp/golang-sdk v0.0.0-20200721095058-9ee3513a54a9 h1:y4fY0Ax8/OUMWvRFr9FkZ9QrKSi4MKsbovt31J3N+us= +github.com/tribalwarshelp/golang-sdk v0.0.0-20200721095058-9ee3513a54a9/go.mod h1:wRoVfjxu4FozpiJmDknv5Zw4AOx/0IC+VttDaSTpBg8= +github.com/tribalwarshelp/shared v0.0.0-20200721094728-9ea33a732990 h1:PwMCKm5Wvqq+tP3KvdqxPtxKtKZTaEONCBT5DvpbVrc= +github.com/tribalwarshelp/shared v0.0.0-20200721094728-9ea33a732990/go.mod h1:tf+2yTHasV6jAF3V2deZ9slNoCyBzC0fMdTjI7clf6Y= github.com/vmihailenco/bufpool v0.1.5/go.mod h1:fL9i/PRTuS7AELqAHwSU1Zf1c70xhkhGe/cD5ud9pJk= github.com/vmihailenco/bufpool v0.1.11 h1:gOq2WmBrq0i2yW5QJ16ykccQ4wH9UyEsgLm6czKAd94= github.com/vmihailenco/bufpool v0.1.11/go.mod h1:AFf/MOy3l2CFTKbxwt0mp2MwnqjNEs5H/UxrkA5jxTQ= diff --git a/message/translations/active.en.json b/message/translations/active.en.json index 54f8421..b57ddca 100644 --- a/message/translations/active.en.json +++ b/message/translations/active.en.json @@ -17,9 +17,9 @@ "help.observe": "**{{.Command}}** [group id from {{.GroupsCommand}}] [server] [tribe id] - command adds a tribe to the observation group.", "help.observations": "**{{.Command}}** [group id from {{.GroupsCommand}}] - shows a list of observed tribes by this group.", "help.deleteobservation": "**{{.Command}}** [group id from {{.GroupsCommand}}] [id from {{.ObservationsCommand}}] - removes a tribe from the observation group.", - "help.conqueredvillages": "**{{.Command}}** [group id from {{.GroupsCommand}}] - changes the channel on which notifications about conquered village will show. **IMPORTANT!** Call this command on the channel you want to display these notifications.", + "help.conqueredvillages": "**{{.Command}}** [group id from {{.GroupsCommand}}] - changes the channel on which notifications about conquered village will show. **IMPORTANT!** Run this command on the channel you want to display these notifications.", "help.disableconqueredvillages": "**{{.Command}}** [group id from {{.GroupsCommand}}] - disable notifications about conquered villages.", - "help.lostvillages": "**{{.Command}}** [group id from {{.GroupsCommand}}] - changes the channel on which notifications about lost village will show. **IMPORTANT!** Call this command on the channel you want to display these notifications.", + "help.lostvillages": "**{{.Command}}** [group id from {{.GroupsCommand}}] - changes the channel on which notifications about lost village will show. **IMPORTANT!** Run this command on the channel you want to display these notifications.", "help.disablelostvillages": "**{{.Command}}** [group id from {{.GroupsCommand}}] - disable notifications about lost villages.", "help.changelanguage": "**{{.Command}}** [{{.Languages}}] - change language.", @@ -91,7 +91,7 @@ "api.defaultError": "{{.Mention}} There was an error fetching data from the API, please try again later.", - "pagination.labelDisplayedPage": "Page: {{.Page}} from {{.MaxPage}}", + "pagination.labelDisplayedPage": "Page: {{.Page}} of {{.MaxPage}}", "internalServerError": "{{.Mention}} Internal server error occurred, please try again later." }