@@ -299,16 +299,15 @@ def select_game(update: Update, context: CallbackContext):
299
299
text = _ ("Game not found." ))
300
300
return
301
301
302
- @run_async
303
- def selected (bot ):
302
+ def selected ():
304
303
back = [[InlineKeyboardButton (text = _ ("Back to last group" ),
305
304
switch_inline_query = '' )]]
306
- context .bot .answerCallbackQuery ( update .callback_query .id ,
305
+ dispatcher . run_async ( context .bot .answerCallbackQuery , update .callback_query .id ,
307
306
text = _ ("Please switch to the group you selected!" ),
308
307
show_alert = False ,
309
308
timeout = TIMEOUT )
310
309
311
- context .bot .editMessageText ( chat_id = update .callback_query .message .chat_id ,
310
+ dispatcher . run_async ( context .bot .editMessageText , chat_id = update .callback_query .message .chat_id ,
312
311
message_id = update .callback_query .message .message_id ,
313
312
text = _ ("Selected group: {group}\n "
314
313
"<b>Make sure that you switch to the correct "
@@ -318,7 +317,7 @@ def selected(bot):
318
317
parse_mode = ParseMode .HTML ,
319
318
timeout = TIMEOUT )
320
319
321
- selected (bot )
320
+ selected ()
322
321
323
322
324
323
@game_locales
@@ -383,15 +382,14 @@ def start_game(update: Update, context: CallbackContext):
383
382
multi = game .translate )
384
383
.format (name = display_name (game .current_player .user )))
385
384
386
- @run_async
387
385
def send_first ():
388
386
"""Send the first card and player"""
389
387
390
- context .bot .sendSticker ( chat .id ,
388
+ dispatcher . run_async ( context .bot .sendSticker , chat .id ,
391
389
sticker = c .STICKERS [str (game .last_card )],
392
390
timeout = TIMEOUT )
393
391
394
- context .bot .sendMessage ( chat .id ,
392
+ dispatcher . run_async ( context .bot .sendMessage , chat .id ,
395
393
text = first_message ,
396
394
reply_markup = InlineKeyboardMarkup (choice ),
397
395
timeout = TIMEOUT )
@@ -702,7 +700,7 @@ def process_result(update: Update, context: CallbackContext):
702
700
send_async (context .bot , chat .id ,
703
701
text = nextplayer_message ,
704
702
reply_markup = InlineKeyboardMarkup (choice ))
705
- start_player_countdown (context .bot , game , job_queue )
703
+ start_player_countdown (context .bot , game , context . job_queue )
706
704
707
705
708
706
def reset_waiting_time (bot , player ):
0 commit comments