🔀 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

11
bot.py
View file

@ -375,7 +375,7 @@ def start_game(bot, update, args, job_queue):
for player in game.players: for player in game.players:
player.draw_first_hand() player.draw_first_hand()
choice = [[InlineKeyboardButton(text=_("Make your choice!"), switch_inline_query_current_chat='')]]
first_message = ( first_message = (
__("First player: {name}\n" __("First player: {name}\n"
"Use /close to stop people from joining the game.\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, bot.sendMessage(chat.id,
text=first_message, text=first_message,
reply_markup=InlineKeyboardMarkup(choice),
timeout=TIMEOUT) timeout=TIMEOUT)
send_first() send_first()
@ -693,9 +694,13 @@ def process_result(bot, update, job_queue):
do_play_card(bot, player, result_id) do_play_card(bot, player, result_id)
if game_is_running(game): if game_is_running(game):
send_async(bot, chat.id, nextplayer_message = (
text=__("Next player: {name}", multi=game.translate) __("Next player: {name}", multi=game.translate)
.format(name=display_name(game.current_player.user))) .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) start_player_countdown(bot, game, job_queue)