diff --git a/README.md b/README.md index d4bb8c6..3a40c34 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,23 @@ # TWHelp DC Bot +Discord bot for the online game Tribal Wars. + Features: 1. Coords translation + ![Screenshot](/screenshots/coordstranslation.png?raw=true) 2. Near real-time notifications about conquers + ![Screenshot](/screenshots/notifications.png?raw=true) 3. Tribe members ordered by OD/ODA/ODD/ODS/points +[You can check all available commands here.](https://dcbot.tribalwarshelp.com/commands/) + ## Development **Required env variables to run this bot** (you can set them directly in your system or create .env.development file): ``` -DB_USER=your_pgDb_user +DB_USER=your_pgdb_user DB_NAME=your_pgdb_name DB_PORT=your_pgdb_port DB_HOST=your_pgdb_host diff --git a/discord/coords_translation.go b/discord/coords_translation.go index 932943a..d69ee83 100644 --- a/discord/coords_translation.go +++ b/discord/coords_translation.go @@ -34,7 +34,7 @@ func (s *Session) handleCoordsTranslationCommand(ctx commandCtx, m *discordgo.Me m.Author.Mention()+" "+ctx.localizer.MustLocalize(&i18n.LocalizeConfig{ MessageID: "help.coordstranslation", DefaultMessage: message.FallbackMsg("help.coordstranslation", - "**{{.Command}}** [server] - enable coords translation feature."), + "**{{.Command}}** [server] - enables coords translation feature."), TemplateData: map[string]interface{}{ "Command": CoordsTranslationCommand.WithPrefix(s.cfg.CommandPrefix), }, diff --git a/discord/observations.go b/discord/observations.go index 52f2046..e0f97e5 100644 --- a/discord/observations.go +++ b/discord/observations.go @@ -699,7 +699,7 @@ func (s *Session) handleObservationsCommand(ctx commandCtx, m *discordgo.Message m.Author.Mention()+" "+ctx.localizer.MustLocalize(&i18n.LocalizeConfig{ MessageID: "help.observations", DefaultMessage: message.FallbackMsg("help.observations", - "**{{.Command}}** [group id from {{.GroupsCommand}}] shows a list of observed tribes by this group."), + "**{{.Command}}** [group id from {{.GroupsCommand}}] - shows a list of observed tribes by this group."), TemplateData: map[string]interface{}{ "Command": ObservationsCommand.WithPrefix(s.cfg.CommandPrefix), "GroupsCommand": GroupsCommand.WithPrefix(s.cfg.CommandPrefix), @@ -926,7 +926,7 @@ func (s *Session) handleChangeLanguageCommand(ctx commandCtx, m *discordgo.Messa m.Author.Mention()+" "+ctx.localizer.MustLocalize(&i18n.LocalizeConfig{ MessageID: "help.changelanguage", DefaultMessage: message.FallbackMsg("help.changelanguage", - "**{{.Command}}** [{{.Languages}}] - change language."), + "**{{.Command}}** [{{.Languages}}] - changes language."), TemplateData: map[string]interface{}{ "Command": ChangeLanguageCommand.WithPrefix(s.cfg.CommandPrefix), "Languages": getAvailableLanguages(), diff --git a/discord/public_commands.go b/discord/public_commands.go index 13f1013..8cec713 100644 --- a/discord/public_commands.go +++ b/discord/public_commands.go @@ -134,7 +134,7 @@ func (s *Session) handleHelpCommand(ctx commandCtx, m *discordgo.MessageCreate) ctx.localizer.MustLocalize(&i18n.LocalizeConfig{ MessageID: "help.observe", DefaultMessage: message.FallbackMsg("help.observe", - "**{{.Command}}** [group id from {{.GroupsCommand}}] [server] [tribe id] - command adds a tribe to the observation group."), + "**{{.Command}}** [group id from {{.GroupsCommand}}] [server] [tribe id] - adds a tribe to the observation group."), TemplateData: map[string]interface{}{ "Command": ObserveCommand.WithPrefix(s.cfg.CommandPrefix), "GroupsCommand": GroupsCommand.WithPrefix(s.cfg.CommandPrefix), @@ -143,7 +143,7 @@ func (s *Session) handleHelpCommand(ctx commandCtx, m *discordgo.MessageCreate) ctx.localizer.MustLocalize(&i18n.LocalizeConfig{ MessageID: "help.observations", DefaultMessage: message.FallbackMsg("help.observations", - "**{{.Command}}** [group id from {{.GroupsCommand}}] shows a list of observed tribes by this group."), + "**{{.Command}}** [group id from {{.GroupsCommand}}] - shows a list of observed tribes by this group."), TemplateData: map[string]interface{}{ "Command": ObservationsCommand.WithPrefix(s.cfg.CommandPrefix), "GroupsCommand": GroupsCommand.WithPrefix(s.cfg.CommandPrefix), @@ -171,7 +171,7 @@ func (s *Session) handleHelpCommand(ctx commandCtx, m *discordgo.MessageCreate) ctx.localizer.MustLocalize(&i18n.LocalizeConfig{ MessageID: "help.disableconqueredvillages", DefaultMessage: message.FallbackMsg("help.disableconqueredvillages", - "**{{.Command}}** [group id from {{.GroupsCommand}}] - disable notifications about conquered villages."), + "**{{.Command}}** [group id from {{.GroupsCommand}}] - disables notifications about conquered villages."), TemplateData: map[string]interface{}{ "Command": DisableConqueredVillagesCommand.WithPrefix(s.cfg.CommandPrefix), "GroupsCommand": GroupsCommand.WithPrefix(s.cfg.CommandPrefix), @@ -217,7 +217,7 @@ func (s *Session) handleHelpCommand(ctx commandCtx, m *discordgo.MessageCreate) ctx.localizer.MustLocalize(&i18n.LocalizeConfig{ MessageID: "help.changelanguage", DefaultMessage: message.FallbackMsg("help.changelanguage", - "**{{.Command}}** [{{.Languages}}] - change language."), + "**{{.Command}}** [{{.Languages}}] - changes language."), TemplateData: map[string]interface{}{ "Command": ChangeLanguageCommand.WithPrefix(s.cfg.CommandPrefix), "Languages": getAvailableLanguages(), @@ -226,7 +226,7 @@ func (s *Session) handleHelpCommand(ctx commandCtx, m *discordgo.MessageCreate) ctx.localizer.MustLocalize(&i18n.LocalizeConfig{ MessageID: "help.coordstranslation", DefaultMessage: message.FallbackMsg("help.coordstranslation", - "**{{.Command}}** [server] - enable coords translation feature."), + "**{{.Command}}** [server] - enables coords translation feature."), TemplateData: map[string]interface{}{ "Command": CoordsTranslationCommand.WithPrefix(s.cfg.CommandPrefix), }, @@ -234,7 +234,7 @@ func (s *Session) handleHelpCommand(ctx commandCtx, m *discordgo.MessageCreate) ctx.localizer.MustLocalize(&i18n.LocalizeConfig{ MessageID: "help.disablecoordstranslation", DefaultMessage: message.FallbackMsg("help.disablecoordstranslation", - "**{{.Command}}** - disable coords translation feature."), + "**{{.Command}}** - disables coords translation feature."), TemplateData: map[string]interface{}{ "Command": DisableCoordsTranslationCommand.WithPrefix(s.cfg.CommandPrefix), }, @@ -258,7 +258,7 @@ func (s *Session) handleHelpCommand(ctx commandCtx, m *discordgo.MessageCreate) })). AddField(ctx.localizer.MustLocalize(&i18n.LocalizeConfig{ MessageID: "help.forAllUsers", - DefaultMessage: message.FallbackMsg("help.forAllUsers", "For all guild members."), + DefaultMessage: message.FallbackMsg("help.forAllUsers", "For all server members."), }), commandsForAll). AddField(forAdmins, commandsForGuildAdmins). AddField(forAdmins+" 2", commandsForGuildAdmins2). diff --git a/message/translations/active.en.json b/message/translations/active.en.json index 839f6cd..efd6f8e 100644 --- a/message/translations/active.en.json +++ b/message/translations/active.en.json @@ -2,7 +2,7 @@ "help.title": "Help", "help.description": "Commands offered by the bot.", "help.footer": "", - "help.forAllUsers": "For all users", + "help.forAllUsers": "For all members", "help.forAdmins": "For admins", "help.tribe.topoda": "**{{.Command}}** [server] [page] [id1] [id2] [id3] [n id] - generates a player list from selected tribes ordered by ODA.", "help.tribe.topodd": "**{{.Command}}** [server] [page] [id1] [id2] [id3] [n id] - generates a player list from selected tribes ordered by ODD.", @@ -14,17 +14,17 @@ "help.groups": "**{{.Command}}** - shows you a list of groups created by this server.", "help.deletegroup": "**{{.Command}}** [group id from {{.GroupsCommand}}] - deletes an observation group.", "help.showennobledbarbs": "**{{.Command}}** [group id from {{.GroupsCommand}}] - enables/disables notifications about ennobling barbarian villages.", - "help.observe": "**{{.Command}}** [group id from {{.GroupsCommand}}] [server] [tribe id] - command adds a tribe to the observation group.", + "help.observe": "**{{.Command}}** [group id from {{.GroupsCommand}}] [server] [tribe id] - 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!** 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.disableconqueredvillages": "**{{.Command}}** [group id from {{.GroupsCommand}}] - disables notifications about conquered villages.", "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.", + "help.disablelostvillages": "**{{.Command}}** [group id from {{.GroupsCommand}}] - disables notifications about lost villages.", + "help.changelanguage": "**{{.Command}}** [{{.Languages}}] - changes language.", "help.showinternals": "**{{.Command}}** [group id from {{.GroupsCommand}}] - enables/disables notifications about in-group/in-tribe conquering.", - "help.coordstranslation": "**{{.Command}}** [server] - enable coords translation feature.", - "help.disablecoordstranslation": "**{{.Command}}** - disable coords translation feature.", + "help.coordstranslation": "**{{.Command}}** [server] - enables coords translation feature.", + "help.disablecoordstranslation": "**{{.Command}}** - disables coords translation feature.", "tribe.invalidPage": "{{.Mention}} The page must be a number greater than 0.", "tribe.noTribeID": "{{.Mention}} You haven't entered the tribe ID.", diff --git a/screenshots/coordstranslation.png b/screenshots/coordstranslation.png new file mode 100644 index 0000000..f26dab9 Binary files /dev/null and b/screenshots/coordstranslation.png differ diff --git a/screenshots/notifications.png b/screenshots/notifications.png new file mode 100644 index 0000000..d800057 Binary files /dev/null and b/screenshots/notifications.png differ