New feature! every player can configure bot's replies language!

This commit is contained in:
spla 2020-12-19 21:00:42 +01:00
pare ba4cca22de
commit ca9ec58dd3
S'han modificat 7 arxius amb 567 adicions i 251 eliminacions

Veure arxiu

@ -46,18 +46,23 @@ Don't use q for queen. Pawn is promoted to Queen by default.
@your_bot_username panel
- To change the bot's language:
@your_bot_username conf en
### Commands table
| ca | en | es | ex. | Observ. |
|:-----:|:-----:|:--------:|:----:|:-----------:|
| nova | new | nueva | | |
| mou | move | mueve | e2e3 | |
| fi | end | fin | | |
| jocs | games | partidas | | |
| envia | send | envia | 1 | game number |
| taules| draw | tablas | | |
| ajuda | help | ayuda | | |
| panell| panel | panel | | |
| ca | en | es | fr | ex. | Observ. |
|:-----:|:-----:|:--------:|:--------:|:----:|:-----------:|
| nova | new | nueva | nouvelle | | |
| mou | move | mueve | déplace | e2e3 | |
| fi | end | fin | fin | | |
| jocs | games | partidas | parties | | |
| envia | send | envia | envoyer | 1 | game number |
| taules| draw | tablas | nulle | | |
| ajuda | help | ayuda | aide | | |
| panell| panel | panel | panneau | | |
| conf | conf | conf | conf | | ca,es,fr,en |
### Dependencies
@ -93,3 +98,5 @@ Within Python Virtual Environment:
03.12.2020 - New feature! Added pgn save & send support
04.12.2020 - New feature! Now players can claim a draw.
05.12.2020 - New feature! Add panel stats.
19.12.2020 - New feature! Now you can configure bot's language!
19.12.2020 - New feature! Added french language!

Veure arxiu

@ -3,6 +3,7 @@ search_move: mou
search_new: nova
search_games: jocs
search_send: envia
search_config: conf
search_help: ajuda
search_draw: taules
new_game_started: partida iniciada! Esperant jugador...
@ -67,3 +68,6 @@ panel_games_str: Partides
panel_wins_str: Victòries
panel_ratio_str: Ràtio
post_my_panel_str: panell (publica les estadístiques)
locale_change_successfully: llengua canviada amb èxit a
locale_not_changed: encara no és suportada :-(
change_lang_str: conf ca (per a configurar el bot en català)

Veure arxiu

@ -3,6 +3,7 @@ search_move: move
search_new: new
search_games: games
search_send: send
search_config: conf
search_help: help
search_draw: draw
new_game_started: game started! Waiting for the second player...
@ -67,3 +68,6 @@ panel_games_str: Games
panel_wins_str: Wins
panel_ratio_str: Ratio
post_my_panel_str: panel (post player stats)
locale_change_successfully: language sucessfully changed to
locale_not_changed: is not supported yet :-(
change_lang_str: conf en (to configure the bot in english)

Veure arxiu

@ -3,6 +3,7 @@ search_move: mueve
search_new: nueva
search_games: partidas
search_send: envia
search_config: conf
search_help: ayuda
search_draw: tablas
new_game_started: partida iniciada! Esperando jugador...
@ -67,3 +68,6 @@ panel_games_str: Partidas
panel_wins_str: Victorias
panel_ratio_str: Ratio
post_my_panel_str: panel (publica el panel de datos)
locale_change_successfully: idioma cambiado con éxito a
locale_not_changed: no es soportado aún :-(
change_lang_str: conf es (para configurar el bot en castellano)

Veure arxiu

@ -3,6 +3,7 @@ search_move: déplace
search_new: nouvelle
search_games: parties
search_send: envoyer
search_config: conf
search_help: aide
search_draw: nulle
new_game_started: partie initié! En attente d'un joueur...
@ -67,3 +68,6 @@ panel_games_str: Parties
panel_wins_str: Victoires
panel_ratio_str: Ratio
post_my_panel_str: panneau (publie les statistiques)
locale_change_successfully: langue modifiée avec succès en
locale_not_changed: n'est pas encore pris en charge :-(
change_lang_str: conf fr (pour configurer le bot en français)

Veure arxiu

@ -168,6 +168,10 @@ if __name__ == '__main__':
sql += "finished boolean default False, updated_at timestamptz, CONSTRAINT fk_game FOREIGN KEY(game_id) REFERENCES games(game_id) ON DELETE CASCADE ON UPDATE CASCADE)"
create_table(db, db_user, table, sql)
table = "players"
sql = "create table "+table+" (player_id bigint PRIMARY KEY, player_name varchar(40), lang varchar(2))"
create_table(db, db_user, table, sql)
############################################################
print("Done!")

La diferencia del archivo ha sido suprimido porque es demasiado grande Cargar Diff