🔀 Merge pull request #73 from Flowiee/patch-1

Added an useful button
This commit is contained in:
Jannes Höke 2019-10-13 21:01:03 +02:00 committed by GitHub
commit 6f3da7b373
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 4 deletions

13
bot.py
View File

@ -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)