From 67d836eaa2ebf90ef75557facdeb9fc589bc2bc0 Mon Sep 17 00:00:00 2001 From: Flowiee <55394031+Flowiee@users.noreply.github.com> Date: Sun, 13 Oct 2019 18:24:47 +0200 Subject: [PATCH] Added an useful button Added "Make your choice!" button for start game message and next player message --- bot.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/bot.py b/bot.py index cdd2ae4..da1337d 100644 --- a/bot.py +++ b/bot.py @@ -375,7 +375,7 @@ def start_game(bot, update, args, job_queue): for player in game.players: player.draw_first_hand() - + choice = [[InlineKeyboardButton(text=_("Make your choice!"), switch_inline_query_current_chat='')]] first_message = ( __("First player: {name}\n" "Use /close to stop people from joining the game.\n" @@ -393,6 +393,7 @@ def start_game(bot, update, args, job_queue): bot.sendMessage(chat.id, text=first_message, + reply_markup=InlineKeyboardMarkup(choice), timeout=TIMEOUT) send_first() @@ -693,9 +694,13 @@ def process_result(bot, update, job_queue): do_play_card(bot, player, result_id) if game_is_running(game): - send_async(bot, chat.id, - text=__("Next player: {name}", multi=game.translate) - .format(name=display_name(game.current_player.user))) + nextplayer_message = ( + __("Next player: {name}", multi=game.translate) + .format(name=display_name(game.current_player.user))) + choice = [[InlineKeyboardButton(text=_("Make your choice!"), switch_inline_query_current_chat='')]] + bot.sendMessage(chat.id, + text=nextplayer_message, + reply_markup=InlineKeyboardMarkup(choice)) start_player_countdown(bot, game, job_queue)