add screenshots, update readme.md

This commit is contained in:
Dawid Wysokiński 2020-09-03 15:13:49 +02:00 committed by Kichiyaki
parent 2a1be4856b
commit 659a811894
7 changed files with 24 additions and 18 deletions

View File

@ -1,17 +1,23 @@
# TWHelp DC Bot # TWHelp DC Bot
Discord bot for the online game Tribal Wars.
Features: Features:
1. Coords translation 1. Coords translation
![Screenshot](/screenshots/coordstranslation.png?raw=true)
2. Near real-time notifications about conquers 2. Near real-time notifications about conquers
![Screenshot](/screenshots/notifications.png?raw=true)
3. Tribe members ordered by OD/ODA/ODD/ODS/points 3. Tribe members ordered by OD/ODA/ODD/ODS/points
[You can check all available commands here.](https://dcbot.tribalwarshelp.com/commands/)
## Development ## Development
**Required env variables to run this bot** (you can set them directly in your system or create .env.development file): **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_NAME=your_pgdb_name
DB_PORT=your_pgdb_port DB_PORT=your_pgdb_port
DB_HOST=your_pgdb_host DB_HOST=your_pgdb_host

View File

@ -34,7 +34,7 @@ func (s *Session) handleCoordsTranslationCommand(ctx commandCtx, m *discordgo.Me
m.Author.Mention()+" "+ctx.localizer.MustLocalize(&i18n.LocalizeConfig{ m.Author.Mention()+" "+ctx.localizer.MustLocalize(&i18n.LocalizeConfig{
MessageID: "help.coordstranslation", MessageID: "help.coordstranslation",
DefaultMessage: message.FallbackMsg("help.coordstranslation", DefaultMessage: message.FallbackMsg("help.coordstranslation",
"**{{.Command}}** [server] - enable coords translation feature."), "**{{.Command}}** [server] - enables coords translation feature."),
TemplateData: map[string]interface{}{ TemplateData: map[string]interface{}{
"Command": CoordsTranslationCommand.WithPrefix(s.cfg.CommandPrefix), "Command": CoordsTranslationCommand.WithPrefix(s.cfg.CommandPrefix),
}, },

View File

@ -699,7 +699,7 @@ func (s *Session) handleObservationsCommand(ctx commandCtx, m *discordgo.Message
m.Author.Mention()+" "+ctx.localizer.MustLocalize(&i18n.LocalizeConfig{ m.Author.Mention()+" "+ctx.localizer.MustLocalize(&i18n.LocalizeConfig{
MessageID: "help.observations", MessageID: "help.observations",
DefaultMessage: message.FallbackMsg("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{}{ TemplateData: map[string]interface{}{
"Command": ObservationsCommand.WithPrefix(s.cfg.CommandPrefix), "Command": ObservationsCommand.WithPrefix(s.cfg.CommandPrefix),
"GroupsCommand": GroupsCommand.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{ m.Author.Mention()+" "+ctx.localizer.MustLocalize(&i18n.LocalizeConfig{
MessageID: "help.changelanguage", MessageID: "help.changelanguage",
DefaultMessage: message.FallbackMsg("help.changelanguage", DefaultMessage: message.FallbackMsg("help.changelanguage",
"**{{.Command}}** [{{.Languages}}] - change language."), "**{{.Command}}** [{{.Languages}}] - changes language."),
TemplateData: map[string]interface{}{ TemplateData: map[string]interface{}{
"Command": ChangeLanguageCommand.WithPrefix(s.cfg.CommandPrefix), "Command": ChangeLanguageCommand.WithPrefix(s.cfg.CommandPrefix),
"Languages": getAvailableLanguages(), "Languages": getAvailableLanguages(),

View File

@ -134,7 +134,7 @@ func (s *Session) handleHelpCommand(ctx commandCtx, m *discordgo.MessageCreate)
ctx.localizer.MustLocalize(&i18n.LocalizeConfig{ ctx.localizer.MustLocalize(&i18n.LocalizeConfig{
MessageID: "help.observe", MessageID: "help.observe",
DefaultMessage: message.FallbackMsg("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{}{ TemplateData: map[string]interface{}{
"Command": ObserveCommand.WithPrefix(s.cfg.CommandPrefix), "Command": ObserveCommand.WithPrefix(s.cfg.CommandPrefix),
"GroupsCommand": GroupsCommand.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{ ctx.localizer.MustLocalize(&i18n.LocalizeConfig{
MessageID: "help.observations", MessageID: "help.observations",
DefaultMessage: message.FallbackMsg("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{}{ TemplateData: map[string]interface{}{
"Command": ObservationsCommand.WithPrefix(s.cfg.CommandPrefix), "Command": ObservationsCommand.WithPrefix(s.cfg.CommandPrefix),
"GroupsCommand": GroupsCommand.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{ ctx.localizer.MustLocalize(&i18n.LocalizeConfig{
MessageID: "help.disableconqueredvillages", MessageID: "help.disableconqueredvillages",
DefaultMessage: message.FallbackMsg("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{}{ TemplateData: map[string]interface{}{
"Command": DisableConqueredVillagesCommand.WithPrefix(s.cfg.CommandPrefix), "Command": DisableConqueredVillagesCommand.WithPrefix(s.cfg.CommandPrefix),
"GroupsCommand": GroupsCommand.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{ ctx.localizer.MustLocalize(&i18n.LocalizeConfig{
MessageID: "help.changelanguage", MessageID: "help.changelanguage",
DefaultMessage: message.FallbackMsg("help.changelanguage", DefaultMessage: message.FallbackMsg("help.changelanguage",
"**{{.Command}}** [{{.Languages}}] - change language."), "**{{.Command}}** [{{.Languages}}] - changes language."),
TemplateData: map[string]interface{}{ TemplateData: map[string]interface{}{
"Command": ChangeLanguageCommand.WithPrefix(s.cfg.CommandPrefix), "Command": ChangeLanguageCommand.WithPrefix(s.cfg.CommandPrefix),
"Languages": getAvailableLanguages(), "Languages": getAvailableLanguages(),
@ -226,7 +226,7 @@ func (s *Session) handleHelpCommand(ctx commandCtx, m *discordgo.MessageCreate)
ctx.localizer.MustLocalize(&i18n.LocalizeConfig{ ctx.localizer.MustLocalize(&i18n.LocalizeConfig{
MessageID: "help.coordstranslation", MessageID: "help.coordstranslation",
DefaultMessage: message.FallbackMsg("help.coordstranslation", DefaultMessage: message.FallbackMsg("help.coordstranslation",
"**{{.Command}}** [server] - enable coords translation feature."), "**{{.Command}}** [server] - enables coords translation feature."),
TemplateData: map[string]interface{}{ TemplateData: map[string]interface{}{
"Command": CoordsTranslationCommand.WithPrefix(s.cfg.CommandPrefix), "Command": CoordsTranslationCommand.WithPrefix(s.cfg.CommandPrefix),
}, },
@ -234,7 +234,7 @@ func (s *Session) handleHelpCommand(ctx commandCtx, m *discordgo.MessageCreate)
ctx.localizer.MustLocalize(&i18n.LocalizeConfig{ ctx.localizer.MustLocalize(&i18n.LocalizeConfig{
MessageID: "help.disablecoordstranslation", MessageID: "help.disablecoordstranslation",
DefaultMessage: message.FallbackMsg("help.disablecoordstranslation", DefaultMessage: message.FallbackMsg("help.disablecoordstranslation",
"**{{.Command}}** - disable coords translation feature."), "**{{.Command}}** - disables coords translation feature."),
TemplateData: map[string]interface{}{ TemplateData: map[string]interface{}{
"Command": DisableCoordsTranslationCommand.WithPrefix(s.cfg.CommandPrefix), "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{ AddField(ctx.localizer.MustLocalize(&i18n.LocalizeConfig{
MessageID: "help.forAllUsers", MessageID: "help.forAllUsers",
DefaultMessage: message.FallbackMsg("help.forAllUsers", "For all guild members."), DefaultMessage: message.FallbackMsg("help.forAllUsers", "For all server members."),
}), commandsForAll). }), commandsForAll).
AddField(forAdmins, commandsForGuildAdmins). AddField(forAdmins, commandsForGuildAdmins).
AddField(forAdmins+" 2", commandsForGuildAdmins2). AddField(forAdmins+" 2", commandsForGuildAdmins2).

View File

@ -2,7 +2,7 @@
"help.title": "Help", "help.title": "Help",
"help.description": "Commands offered by the bot.", "help.description": "Commands offered by the bot.",
"help.footer": "", "help.footer": "",
"help.forAllUsers": "For all users", "help.forAllUsers": "For all members",
"help.forAdmins": "For admins", "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.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.", "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.groups": "**{{.Command}}** - shows you a list of groups created by this server.",
"help.deletegroup": "**{{.Command}}** [group id from {{.GroupsCommand}}] - deletes an observation group.", "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.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.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.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.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.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.disablelostvillages": "**{{.Command}}** [group id from {{.GroupsCommand}}] - disables notifications about lost villages.",
"help.changelanguage": "**{{.Command}}** [{{.Languages}}] - change language.", "help.changelanguage": "**{{.Command}}** [{{.Languages}}] - changes language.",
"help.showinternals": "**{{.Command}}** [group id from {{.GroupsCommand}}] - enables/disables notifications about in-group/in-tribe conquering.", "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.coordstranslation": "**{{.Command}}** [server] - enables coords translation feature.",
"help.disablecoordstranslation": "**{{.Command}}** - disable coords translation feature.", "help.disablecoordstranslation": "**{{.Command}}** - disables coords translation feature.",
"tribe.invalidPage": "{{.Mention}} The page must be a number greater than 0.", "tribe.invalidPage": "{{.Mention}} The page must be a number greater than 0.",
"tribe.noTribeID": "{{.Mention}} You haven't entered the tribe ID.", "tribe.noTribeID": "{{.Mention}} You haven't entered the tribe ID.",

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB