From ef8955bf4919c30232c2c0c062ec924aba0f8894 Mon Sep 17 00:00:00 2001 From: Flowiee <55394031+Flowiee@users.noreply.github.com> Date: Mon, 14 Oct 2019 20:03:35 +0200 Subject: [PATCH 01/11] Update bot.py --- bot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bot.py b/bot.py index 634997d..994d201 100644 --- a/bot.py +++ b/bot.py @@ -36,7 +36,7 @@ from errors import (NoGameInChatError, LobbyClosedError, AlreadyJoinedError, from internationalization import _, __, user_locale, game_locales from results import (add_call_bluff, add_choose_color, add_draw, add_gameinfo, add_no_game, add_not_started, add_other_cards, add_pass, - add_card, add_mode_classic, add_mode_fast, add_mode_wild) + add_card, add_mode_classic, add_mode_fast, add_mode_wild, add_mode_text) from shared_vars import gm, updater, dispatcher from simple_commands import help_handler from start_bot import start_bot @@ -595,6 +595,7 @@ def reply_to_query(bot, update): add_mode_classic(results) add_mode_fast(results) add_mode_wild(results) + add_mode_text(results) else: add_not_started(results) From d5a3376eff5770dc7b94d4f3f8bdff6b82dbd8cc Mon Sep 17 00:00:00 2001 From: Flowiee <55394031+Flowiee@users.noreply.github.com> Date: Mon, 14 Oct 2019 20:05:32 +0200 Subject: [PATCH 02/11] Update card.py --- card.py | 56 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/card.py b/card.py index 63ddd8e..22cfb82 100644 --- a/card.py +++ b/card.py @@ -71,9 +71,9 @@ STICKERS = { 'b_7': 'BQADBAAD5wEAAl9XmQABVhPF6EcfWjEC', 'b_8': 'BQADBAAD6QEAAl9XmQABP6baig0pIvYC', 'b_9': 'BQADBAAD6wEAAl9XmQAB0CQdsQs_pXIC', - 'b_draw': 'BQADBAAD7QEAAl9XmQAB00Wii7R3gDUC', - 'b_skip': 'BQADBAAD8QEAAl9XmQAB_RJHYKqlc-wC', - 'b_reverse': 'BQADBAAD7wEAAl9XmQABo7D0B9NUPmYC', + 'b_+2': 'BQADBAAD7QEAAl9XmQAB00Wii7R3gDUC', + 'b_Skip': 'BQADBAAD8QEAAl9XmQAB_RJHYKqlc-wC', + 'b_Reverse': 'BQADBAAD7wEAAl9XmQABo7D0B9NUPmYC', 'g_0': 'BQADBAAD9wEAAl9XmQABb8CaxxsQ-Y8C', 'g_1': 'BQADBAAD-QEAAl9XmQAB9B6ti_j6UB0C', 'g_2': 'BQADBAAD-wEAAl9XmQABYpLjOzbRz8EC', @@ -84,9 +84,9 @@ STICKERS = { 'g_7': 'BQADBAADBQIAAl9XmQABv5Q264Crz8gC', 'g_8': 'BQADBAADBwIAAl9XmQABjMH-X9UHh8sC', 'g_9': 'BQADBAADCQIAAl9XmQAB26fZ2fW7vM0C', - 'g_draw': 'BQADBAADCwIAAl9XmQAB64jIZrgXrQUC', - 'g_skip': 'BQADBAADDwIAAl9XmQAB17yhhnh46VQC', - 'g_reverse': 'BQADBAADDQIAAl9XmQAB_xcaab0DkegC', + 'g_+2': 'BQADBAADCwIAAl9XmQAB64jIZrgXrQUC', + 'g_Skip': 'BQADBAADDwIAAl9XmQAB17yhhnh46VQC', + 'g_Reverse': 'BQADBAADDQIAAl9XmQAB_xcaab0DkegC', 'r_0': 'BQADBAADEQIAAl9XmQABiUfr1hz-zT8C', 'r_1': 'BQADBAADEwIAAl9XmQAB5bWfwJGs6Q0C', 'r_2': 'BQADBAADFQIAAl9XmQABHR4mg9Ifjw0C', @@ -97,9 +97,9 @@ STICKERS = { 'r_7': 'BQADBAADHwIAAl9XmQABCw8u67Q4EK4C', 'r_8': 'BQADBAADIQIAAl9XmQAB8iDJmLxp8ogC', 'r_9': 'BQADBAADIwIAAl9XmQAB_HCAww1kNGYC', - 'r_draw': 'BQADBAADJQIAAl9XmQABuz0OZ4l3k6MC', - 'r_skip': 'BQADBAADKQIAAl9XmQAC2AL5Ok_ULwI', - 'r_reverse': 'BQADBAADJwIAAl9XmQABu2tIeQTpDvUC', + 'r_+2': 'BQADBAADJQIAAl9XmQABuz0OZ4l3k6MC', + 'r_Skip': 'BQADBAADKQIAAl9XmQAC2AL5Ok_ULwI', + 'r_Reverse': 'BQADBAADJwIAAl9XmQABu2tIeQTpDvUC', 'y_0': 'BQADBAADKwIAAl9XmQAB_nWoNKe8DOQC', 'y_1': 'BQADBAADLQIAAl9XmQABVprAGUDKgOQC', 'y_2': 'BQADBAADLwIAAl9XmQABqyT4_YTm54EC', @@ -110,11 +110,11 @@ STICKERS = { 'y_7': 'BQADBAADOQIAAl9XmQABVrd7OcS2k34C', 'y_8': 'BQADBAADOwIAAl9XmQABRpJSahBWk3EC', 'y_9': 'BQADBAADPQIAAl9XmQAB9MwJWKLJogYC', - 'y_draw': 'BQADBAADPwIAAl9XmQABaPYK8oYg84cC', - 'y_skip': 'BQADBAADQwIAAl9XmQABO_AZKtxY6IMC', - 'y_reverse': 'BQADBAADQQIAAl9XmQABZdQFahGG6UQC', - 'draw_four': 'BQADBAAD9QEAAl9XmQABVlkSNfhn76cC', - 'colorchooser': 'BQADBAAD8wEAAl9XmQABl9rUOPqx4E4C', + 'y_+2': 'BQADBAADPwIAAl9XmQABaPYK8oYg84cC', + 'y_Skip': 'BQADBAADQwIAAl9XmQABO_AZKtxY6IMC', + 'y_Reverse': 'BQADBAADQQIAAl9XmQABZdQFahGG6UQC', + '+4': 'BQADBAAD9QEAAl9XmQABVlkSNfhn76cC', + 'Colorchooser': 'BQADBAAD8wEAAl9XmQABl9rUOPqx4E4C', 'option_draw': 'BQADBAAD-AIAAl9XmQABxEjEcFM-VHIC', 'option_pass': 'BQADBAAD-gIAAl9XmQABcEkAAbaZ4SicAg', 'option_bluff': 'BQADBAADygIAAl9XmQABJoLfB9ntI2UC', @@ -132,9 +132,9 @@ STICKERS_GREY = { 'b_7': 'BQADBAADUwIAAl9XmQABXb5XQBBaAnIC', 'b_8': 'BQADBAADVQIAAl9XmQABgL5HRDLvrjgC', 'b_9': 'BQADBAADVwIAAl9XmQABtO3XDQWZLtYC', - 'b_draw': 'BQADBAADWQIAAl9XmQAB2kk__6_2IhMC', - 'b_skip': 'BQADBAADXQIAAl9XmQABEGJI6CaH3vcC', - 'b_reverse': 'BQADBAADWwIAAl9XmQAB_kZA6UdHXU8C', + 'b_+2': 'BQADBAADWQIAAl9XmQAB2kk__6_2IhMC', + 'b_Skip': 'BQADBAADXQIAAl9XmQABEGJI6CaH3vcC', + 'b_Reverse': 'BQADBAADWwIAAl9XmQAB_kZA6UdHXU8C', 'g_0': 'BQADBAADYwIAAl9XmQABGD5a9oG7Yg4C', 'g_1': 'BQADBAADZQIAAl9XmQABqwABZHAXZIg0Ag', 'g_2': 'BQADBAADZwIAAl9XmQABTI3mrEhojRkC', @@ -145,9 +145,9 @@ STICKERS_GREY = { 'g_7': 'BQADBAADcQIAAl9XmQABDeaT5fzxwREC', 'g_8': 'BQADBAADcwIAAl9XmQABLIQ06ZM5NnAC', 'g_9': 'BQADBAADdQIAAl9XmQABel-mC7eXGsMC', - 'g_draw': 'BQADBAADdwIAAl9XmQABOHEpxSztCf8C', - 'g_skip': 'BQADBAADewIAAl9XmQABDaQdMxjjPsoC', - 'g_reverse': 'BQADBAADeQIAAl9XmQABek1lGz7SJNAC', + 'g_+2': 'BQADBAADdwIAAl9XmQABOHEpxSztCf8C', + 'g_Skip': 'BQADBAADewIAAl9XmQABDaQdMxjjPsoC', + 'g_Reverse': 'BQADBAADeQIAAl9XmQABek1lGz7SJNAC', 'r_0': 'BQADBAADfQIAAl9XmQABWrxoiXcsg0EC', 'r_1': 'BQADBAADfwIAAl9XmQABlav-bkgSgRcC', 'r_2': 'BQADBAADgQIAAl9XmQABDjZkqfJ4AdAC', @@ -158,9 +158,9 @@ STICKERS_GREY = { 'r_7': 'BQADBAADiwIAAl9XmQABjekJfm4fBDIC', 'r_8': 'BQADBAADjQIAAl9XmQABqFjchpsJeEkC', 'r_9': 'BQADBAADjwIAAl9XmQAB-sKdcgABdNKDAg', - 'r_draw': 'BQADBAADkQIAAl9XmQABtw9RPVDHZOQC', - 'r_skip': 'BQADBAADlQIAAl9XmQABtG2GixCxtX4C', - 'r_reverse': 'BQADBAADkwIAAl9XmQABz2qyEbabnVsC', + 'r_+2': 'BQADBAADkQIAAl9XmQABtw9RPVDHZOQC', + 'r_Skip': 'BQADBAADlQIAAl9XmQABtG2GixCxtX4C', + 'r_Reverse': 'BQADBAADkwIAAl9XmQABz2qyEbabnVsC', 'y_0': 'BQADBAADlwIAAl9XmQABAb3ZwTGS1lMC', 'y_1': 'BQADBAADmQIAAl9XmQAB9v5qJk9R0x8C', 'y_2': 'BQADBAADmwIAAl9XmQABCsgpRHC2g-cC', @@ -171,11 +171,11 @@ STICKERS_GREY = { 'y_7': 'BQADBAADpQIAAl9XmQABoBqC0JsemVwC', 'y_8': 'BQADBAADpwIAAl9XmQABpkwAAeh9ldlHAg', 'y_9': 'BQADBAADqQIAAl9XmQABpSBEUfd4IM8C', - 'y_draw': 'BQADBAADqwIAAl9XmQABMt-2zW0VYb4C', - 'y_skip': 'BQADBAADrwIAAl9XmQABIDf-_TuuxtEC', - 'y_reverse': 'BQADBAADrQIAAl9XmQABm9M0Zh-_UwkC', - 'draw_four': 'BQADBAADYQIAAl9XmQAB_HWlvZIscDEC', - 'colorchooser': 'BQADBAADXwIAAl9XmQABY_ksDdMex-wC' + 'y_+2': 'BQADBAADqwIAAl9XmQABMt-2zW0VYb4C', + 'y_Skip': 'BQADBAADrwIAAl9XmQABIDf-_TuuxtEC', + 'y_Reverse': 'BQADBAADrQIAAl9XmQABm9M0Zh-_UwkC', + '+4': 'BQADBAADYQIAAl9XmQAB_HWlvZIscDEC', + 'Colorchooser': 'BQADBAADXwIAAl9XmQABY_ksDdMex-wC' } From 7d3be19196129160185a18aaf1c65caf5f347bb4 Mon Sep 17 00:00:00 2001 From: Flowiee <55394031+Flowiee@users.noreply.github.com> Date: Mon, 14 Oct 2019 20:08:16 +0200 Subject: [PATCH 03/11] Update results.py --- results.py | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/results.py b/results.py index 1203154..c93ed37 100644 --- a/results.py +++ b/results.py @@ -130,6 +130,18 @@ def add_mode_wild(results): ) +def add_mode_text(results): + """Change mode to text""" + results.append( + InlineQueryResultArticle( + "mode_text", + title=_("✍️ Text mode"), + input_message_content= + InputTextMessageContent(_('Text ✍️')) + ) + ) + + def add_draw(player, results): """Add option to draw""" n = player.game.draw_counter or 1 @@ -187,9 +199,14 @@ def add_card(game, card, results, can_play): """Add an option that represents a card""" if can_play: - results.append( - Sticker(str(card), sticker_file_id=c.STICKERS[str(card)]) + if game.mode != "text": + results.append( + Sticker(str(card), sticker_file_id=c.STICKERS[str(card)]) ) + if game.mode == "text": + results.append( + Sticker(str(card), sticker_file_id=c.STICKERS[str(card)], input_message_content=InputTextMessageContent("Card Played: {card}".format(card=repr(card))) + )) else: results.append( Sticker(str(uuid4()), sticker_file_id=c.STICKERS_GREY[str(card)], @@ -209,4 +226,4 @@ def game_info(game): "Players: {player_list}", len(players)) .format(player_list=" -> ".join(players)) - ) \ No newline at end of file + ) From 17cd46c4f5080aea5982b01c3259cf9e76a5d89d Mon Sep 17 00:00:00 2001 From: Flowiee <55394031+Flowiee@users.noreply.github.com> Date: Mon, 14 Oct 2019 20:09:48 +0200 Subject: [PATCH 04/11] Update simple_commands.py --- simple_commands.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/simple_commands.py b/simple_commands.py index 4e54c95..9e7fba5 100644 --- a/simple_commands.py +++ b/simple_commands.py @@ -70,10 +70,11 @@ def help_handler(bot, update): @user_locale def modes(bot, update): """Handler for the /help command""" - modes_explanation = _("This UNO bot has three game modes: Classic, Sanic and Wild.\n\n" + modes_explanation = _("This UNO bot has four game modes: Classic, Sanic, Wild and Texr.\n\n" " 🎻 The Classic mode uses the conventional UNO deck and there is no auto skip.\n" " πŸš€ The Sanic mode uses the conventional UNO deck and the bot automatically skips a player if he/she takes too long to play its turn\n" - " πŸ‰ The Wild mode uses a deck with more special cards, less number variety and no auto skip.\n\n" + " πŸ‰ The Wild mode uses a deck with more special cards, less number variety and no auto skip.\n" + " ✍️ The Text mode uses the conventional UNO deck but instead of stickers it uses the text.\n\n" "To change the game mode, the GAME CREATOR has to type the bot nickname and a space, " "just like when playing a card, and all gamemode options should appear.") send_async(bot, update.message.chat_id, text=modes_explanation, From 38443490ee4cee64dee3473ef8a9c9c8098f5188 Mon Sep 17 00:00:00 2001 From: Flowiee <55394031+Flowiee@users.noreply.github.com> Date: Tue, 15 Oct 2019 17:56:30 +0200 Subject: [PATCH 05/11] Update card.py --- card.py | 56 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/card.py b/card.py index 22cfb82..63ddd8e 100644 --- a/card.py +++ b/card.py @@ -71,9 +71,9 @@ STICKERS = { 'b_7': 'BQADBAAD5wEAAl9XmQABVhPF6EcfWjEC', 'b_8': 'BQADBAAD6QEAAl9XmQABP6baig0pIvYC', 'b_9': 'BQADBAAD6wEAAl9XmQAB0CQdsQs_pXIC', - 'b_+2': 'BQADBAAD7QEAAl9XmQAB00Wii7R3gDUC', - 'b_Skip': 'BQADBAAD8QEAAl9XmQAB_RJHYKqlc-wC', - 'b_Reverse': 'BQADBAAD7wEAAl9XmQABo7D0B9NUPmYC', + 'b_draw': 'BQADBAAD7QEAAl9XmQAB00Wii7R3gDUC', + 'b_skip': 'BQADBAAD8QEAAl9XmQAB_RJHYKqlc-wC', + 'b_reverse': 'BQADBAAD7wEAAl9XmQABo7D0B9NUPmYC', 'g_0': 'BQADBAAD9wEAAl9XmQABb8CaxxsQ-Y8C', 'g_1': 'BQADBAAD-QEAAl9XmQAB9B6ti_j6UB0C', 'g_2': 'BQADBAAD-wEAAl9XmQABYpLjOzbRz8EC', @@ -84,9 +84,9 @@ STICKERS = { 'g_7': 'BQADBAADBQIAAl9XmQABv5Q264Crz8gC', 'g_8': 'BQADBAADBwIAAl9XmQABjMH-X9UHh8sC', 'g_9': 'BQADBAADCQIAAl9XmQAB26fZ2fW7vM0C', - 'g_+2': 'BQADBAADCwIAAl9XmQAB64jIZrgXrQUC', - 'g_Skip': 'BQADBAADDwIAAl9XmQAB17yhhnh46VQC', - 'g_Reverse': 'BQADBAADDQIAAl9XmQAB_xcaab0DkegC', + 'g_draw': 'BQADBAADCwIAAl9XmQAB64jIZrgXrQUC', + 'g_skip': 'BQADBAADDwIAAl9XmQAB17yhhnh46VQC', + 'g_reverse': 'BQADBAADDQIAAl9XmQAB_xcaab0DkegC', 'r_0': 'BQADBAADEQIAAl9XmQABiUfr1hz-zT8C', 'r_1': 'BQADBAADEwIAAl9XmQAB5bWfwJGs6Q0C', 'r_2': 'BQADBAADFQIAAl9XmQABHR4mg9Ifjw0C', @@ -97,9 +97,9 @@ STICKERS = { 'r_7': 'BQADBAADHwIAAl9XmQABCw8u67Q4EK4C', 'r_8': 'BQADBAADIQIAAl9XmQAB8iDJmLxp8ogC', 'r_9': 'BQADBAADIwIAAl9XmQAB_HCAww1kNGYC', - 'r_+2': 'BQADBAADJQIAAl9XmQABuz0OZ4l3k6MC', - 'r_Skip': 'BQADBAADKQIAAl9XmQAC2AL5Ok_ULwI', - 'r_Reverse': 'BQADBAADJwIAAl9XmQABu2tIeQTpDvUC', + 'r_draw': 'BQADBAADJQIAAl9XmQABuz0OZ4l3k6MC', + 'r_skip': 'BQADBAADKQIAAl9XmQAC2AL5Ok_ULwI', + 'r_reverse': 'BQADBAADJwIAAl9XmQABu2tIeQTpDvUC', 'y_0': 'BQADBAADKwIAAl9XmQAB_nWoNKe8DOQC', 'y_1': 'BQADBAADLQIAAl9XmQABVprAGUDKgOQC', 'y_2': 'BQADBAADLwIAAl9XmQABqyT4_YTm54EC', @@ -110,11 +110,11 @@ STICKERS = { 'y_7': 'BQADBAADOQIAAl9XmQABVrd7OcS2k34C', 'y_8': 'BQADBAADOwIAAl9XmQABRpJSahBWk3EC', 'y_9': 'BQADBAADPQIAAl9XmQAB9MwJWKLJogYC', - 'y_+2': 'BQADBAADPwIAAl9XmQABaPYK8oYg84cC', - 'y_Skip': 'BQADBAADQwIAAl9XmQABO_AZKtxY6IMC', - 'y_Reverse': 'BQADBAADQQIAAl9XmQABZdQFahGG6UQC', - '+4': 'BQADBAAD9QEAAl9XmQABVlkSNfhn76cC', - 'Colorchooser': 'BQADBAAD8wEAAl9XmQABl9rUOPqx4E4C', + 'y_draw': 'BQADBAADPwIAAl9XmQABaPYK8oYg84cC', + 'y_skip': 'BQADBAADQwIAAl9XmQABO_AZKtxY6IMC', + 'y_reverse': 'BQADBAADQQIAAl9XmQABZdQFahGG6UQC', + 'draw_four': 'BQADBAAD9QEAAl9XmQABVlkSNfhn76cC', + 'colorchooser': 'BQADBAAD8wEAAl9XmQABl9rUOPqx4E4C', 'option_draw': 'BQADBAAD-AIAAl9XmQABxEjEcFM-VHIC', 'option_pass': 'BQADBAAD-gIAAl9XmQABcEkAAbaZ4SicAg', 'option_bluff': 'BQADBAADygIAAl9XmQABJoLfB9ntI2UC', @@ -132,9 +132,9 @@ STICKERS_GREY = { 'b_7': 'BQADBAADUwIAAl9XmQABXb5XQBBaAnIC', 'b_8': 'BQADBAADVQIAAl9XmQABgL5HRDLvrjgC', 'b_9': 'BQADBAADVwIAAl9XmQABtO3XDQWZLtYC', - 'b_+2': 'BQADBAADWQIAAl9XmQAB2kk__6_2IhMC', - 'b_Skip': 'BQADBAADXQIAAl9XmQABEGJI6CaH3vcC', - 'b_Reverse': 'BQADBAADWwIAAl9XmQAB_kZA6UdHXU8C', + 'b_draw': 'BQADBAADWQIAAl9XmQAB2kk__6_2IhMC', + 'b_skip': 'BQADBAADXQIAAl9XmQABEGJI6CaH3vcC', + 'b_reverse': 'BQADBAADWwIAAl9XmQAB_kZA6UdHXU8C', 'g_0': 'BQADBAADYwIAAl9XmQABGD5a9oG7Yg4C', 'g_1': 'BQADBAADZQIAAl9XmQABqwABZHAXZIg0Ag', 'g_2': 'BQADBAADZwIAAl9XmQABTI3mrEhojRkC', @@ -145,9 +145,9 @@ STICKERS_GREY = { 'g_7': 'BQADBAADcQIAAl9XmQABDeaT5fzxwREC', 'g_8': 'BQADBAADcwIAAl9XmQABLIQ06ZM5NnAC', 'g_9': 'BQADBAADdQIAAl9XmQABel-mC7eXGsMC', - 'g_+2': 'BQADBAADdwIAAl9XmQABOHEpxSztCf8C', - 'g_Skip': 'BQADBAADewIAAl9XmQABDaQdMxjjPsoC', - 'g_Reverse': 'BQADBAADeQIAAl9XmQABek1lGz7SJNAC', + 'g_draw': 'BQADBAADdwIAAl9XmQABOHEpxSztCf8C', + 'g_skip': 'BQADBAADewIAAl9XmQABDaQdMxjjPsoC', + 'g_reverse': 'BQADBAADeQIAAl9XmQABek1lGz7SJNAC', 'r_0': 'BQADBAADfQIAAl9XmQABWrxoiXcsg0EC', 'r_1': 'BQADBAADfwIAAl9XmQABlav-bkgSgRcC', 'r_2': 'BQADBAADgQIAAl9XmQABDjZkqfJ4AdAC', @@ -158,9 +158,9 @@ STICKERS_GREY = { 'r_7': 'BQADBAADiwIAAl9XmQABjekJfm4fBDIC', 'r_8': 'BQADBAADjQIAAl9XmQABqFjchpsJeEkC', 'r_9': 'BQADBAADjwIAAl9XmQAB-sKdcgABdNKDAg', - 'r_+2': 'BQADBAADkQIAAl9XmQABtw9RPVDHZOQC', - 'r_Skip': 'BQADBAADlQIAAl9XmQABtG2GixCxtX4C', - 'r_Reverse': 'BQADBAADkwIAAl9XmQABz2qyEbabnVsC', + 'r_draw': 'BQADBAADkQIAAl9XmQABtw9RPVDHZOQC', + 'r_skip': 'BQADBAADlQIAAl9XmQABtG2GixCxtX4C', + 'r_reverse': 'BQADBAADkwIAAl9XmQABz2qyEbabnVsC', 'y_0': 'BQADBAADlwIAAl9XmQABAb3ZwTGS1lMC', 'y_1': 'BQADBAADmQIAAl9XmQAB9v5qJk9R0x8C', 'y_2': 'BQADBAADmwIAAl9XmQABCsgpRHC2g-cC', @@ -171,11 +171,11 @@ STICKERS_GREY = { 'y_7': 'BQADBAADpQIAAl9XmQABoBqC0JsemVwC', 'y_8': 'BQADBAADpwIAAl9XmQABpkwAAeh9ldlHAg', 'y_9': 'BQADBAADqQIAAl9XmQABpSBEUfd4IM8C', - 'y_+2': 'BQADBAADqwIAAl9XmQABMt-2zW0VYb4C', - 'y_Skip': 'BQADBAADrwIAAl9XmQABIDf-_TuuxtEC', - 'y_Reverse': 'BQADBAADrQIAAl9XmQABm9M0Zh-_UwkC', - '+4': 'BQADBAADYQIAAl9XmQAB_HWlvZIscDEC', - 'Colorchooser': 'BQADBAADXwIAAl9XmQABY_ksDdMex-wC' + 'y_draw': 'BQADBAADqwIAAl9XmQABMt-2zW0VYb4C', + 'y_skip': 'BQADBAADrwIAAl9XmQABIDf-_TuuxtEC', + 'y_reverse': 'BQADBAADrQIAAl9XmQABm9M0Zh-_UwkC', + 'draw_four': 'BQADBAADYQIAAl9XmQAB_HWlvZIscDEC', + 'colorchooser': 'BQADBAADXwIAAl9XmQABY_ksDdMex-wC' } From fd075a8535267055071cd9dc586f844b882141ef Mon Sep 17 00:00:00 2001 From: Flowiee <55394031+Flowiee@users.noreply.github.com> Date: Thu, 17 Oct 2019 16:53:56 +0200 Subject: [PATCH 06/11] Update results.py --- results.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/results.py b/results.py index c93ed37..7c94cb1 100644 --- a/results.py +++ b/results.py @@ -26,7 +26,7 @@ from telegram import InlineQueryResultArticle, InputTextMessageContent, \ InlineQueryResultCachedSticker as Sticker import card as c -from utils import display_color, display_color_group, display_name +from utils import display_color, display_color_group, display_name, display_card_text from internationalization import _, __ @@ -205,7 +205,7 @@ def add_card(game, card, results, can_play): ) if game.mode == "text": results.append( - Sticker(str(card), sticker_file_id=c.STICKERS[str(card)], input_message_content=InputTextMessageContent("Card Played: {card}".format(card=repr(card))) + Sticker(str(card), sticker_file_id=c.STICKERS[str(card)], input_message_content=InputTextMessageContent("Card Played: {card}".format(card=display_card_text(card))) )) else: results.append( From 39aad0cc9f89e71b972e089e20fd43f762950ca4 Mon Sep 17 00:00:00 2001 From: Flowiee <55394031+Flowiee@users.noreply.github.com> Date: Thu, 17 Oct 2019 16:58:11 +0200 Subject: [PATCH 07/11] Update utils.py --- utils.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/utils.py b/utils.py index 23b90b6..eabc225 100644 --- a/utils.py +++ b/utils.py @@ -25,6 +25,7 @@ from telegram.ext.dispatcher import run_async from internationalization import _, __ from mwt import MWT from shared_vars import gm +import card as c logger = logging.getLogger(__name__) @@ -75,7 +76,25 @@ def display_color_group(color, game): if color == "y": return __("{emoji} Yellow", game.translate).format( emoji='πŸ’›') - + + +def display_card_text(card): + if card.special == c.DRAW_FOUR: + return __("⬛️+4") + if card.special == c.CHOOSE: + return __("⬛️Color Chooser") + if card.value == c.DRAW_TWO: + if card.color == 'r': + return __("❀️+2") + if card.color == 'b': + return __("πŸ’™+2") + if card.color == 'g': + return __("πŸ’š+2") + if card.color == 'y': + return __("πŸ’›+2") + else: + return repr(card) + def error(bot, update, error): """Simple error handler""" From 5bea31676abcfb1b522f522b72098e5b9b835aef Mon Sep 17 00:00:00 2001 From: Flowiee <55394031+Flowiee@users.noreply.github.com> Date: Fri, 18 Oct 2019 15:27:28 +0200 Subject: [PATCH 08/11] Update results.py --- results.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/results.py b/results.py index 7c94cb1..0646f9c 100644 --- a/results.py +++ b/results.py @@ -205,7 +205,7 @@ def add_card(game, card, results, can_play): ) if game.mode == "text": results.append( - Sticker(str(card), sticker_file_id=c.STICKERS[str(card)], input_message_content=InputTextMessageContent("Card Played: {card}".format(card=display_card_text(card))) + Sticker(str(card), sticker_file_id=c.STICKERS[str(card)], input_message_content=InputTextMessageContent("Card Played: {card}".format(card=repr(card).replace('Draw Four', '+4').replace('Draw', '+2').replace('Colorchooser', 'Color Chooser'))) )) else: results.append( From c6e1dcacb34266422d5796d5b67b7c6385299c46 Mon Sep 17 00:00:00 2001 From: Flowiee <55394031+Flowiee@users.noreply.github.com> Date: Fri, 18 Oct 2019 15:27:47 +0200 Subject: [PATCH 09/11] Update results.py --- results.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/results.py b/results.py index 0646f9c..1f542fe 100644 --- a/results.py +++ b/results.py @@ -26,7 +26,7 @@ from telegram import InlineQueryResultArticle, InputTextMessageContent, \ InlineQueryResultCachedSticker as Sticker import card as c -from utils import display_color, display_color_group, display_name, display_card_text +from utils import display_color, display_color_group, display_name from internationalization import _, __ From 22c454e149237c533383fab62d91b8b6cb302417 Mon Sep 17 00:00:00 2001 From: Flowiee <55394031+Flowiee@users.noreply.github.com> Date: Fri, 18 Oct 2019 15:28:48 +0200 Subject: [PATCH 10/11] Update utils.py --- utils.py | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/utils.py b/utils.py index eabc225..e32f51e 100644 --- a/utils.py +++ b/utils.py @@ -25,7 +25,6 @@ from telegram.ext.dispatcher import run_async from internationalization import _, __ from mwt import MWT from shared_vars import gm -import card as c logger = logging.getLogger(__name__) @@ -76,25 +75,7 @@ def display_color_group(color, game): if color == "y": return __("{emoji} Yellow", game.translate).format( emoji='πŸ’›') - - -def display_card_text(card): - if card.special == c.DRAW_FOUR: - return __("⬛️+4") - if card.special == c.CHOOSE: - return __("⬛️Color Chooser") - if card.value == c.DRAW_TWO: - if card.color == 'r': - return __("❀️+2") - if card.color == 'b': - return __("πŸ’™+2") - if card.color == 'g': - return __("πŸ’š+2") - if card.color == 'y': - return __("πŸ’›+2") - else: - return repr(card) - + def error(bot, update, error): """Simple error handler""" From 93f547c57b7320e5ba3a0c324267d23b29b4b968 Mon Sep 17 00:00:00 2001 From: Flowiee <55394031+Flowiee@users.noreply.github.com> Date: Fri, 18 Oct 2019 15:47:22 +0200 Subject: [PATCH 11/11] Update simple_commands.py --- simple_commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simple_commands.py b/simple_commands.py index 9e7fba5..ca46d60 100644 --- a/simple_commands.py +++ b/simple_commands.py @@ -70,7 +70,7 @@ def help_handler(bot, update): @user_locale def modes(bot, update): """Handler for the /help command""" - modes_explanation = _("This UNO bot has four game modes: Classic, Sanic, Wild and Texr.\n\n" + modes_explanation = _("This UNO bot has four game modes: Classic, Sanic, Wild and Text.\n\n" " 🎻 The Classic mode uses the conventional UNO deck and there is no auto skip.\n" " πŸš€ The Sanic mode uses the conventional UNO deck and the bot automatically skips a player if he/she takes too long to play its turn\n" " πŸ‰ The Wild mode uses a deck with more special cards, less number variety and no auto skip.\n"