From 10188f7052e413f6d61d54ce71ee67507f8fc5e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9A=E7=BE=85=E7=8B=BC?= Date: Mon, 30 Oct 2023 01:47:41 +0800 Subject: [PATCH] Update __init__.py --- modules/tic_tac_toe/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/tic_tac_toe/__init__.py b/modules/tic_tac_toe/__init__.py index e40e4ae6..a06c9b19 100644 --- a/modules/tic_tac_toe/__init__.py +++ b/modules/tic_tac_toe/__init__.py @@ -290,10 +290,10 @@ async def ttt_with_bot(msg: Bot.MessageSession): if winner == 0: await msg.finish(format_board(board) + '\n' + msg.locale.t('tic_tac_toe.message.draw'), quote=False) if winner == 1: - if game_type is 'random': - g_msg = '\n' + gained_petal(msg, 1) - if game_type is 'expert': - g_msg = '\n' + gained_petal(msg, 2) + if game_type is 'random' and reward := gained_petal(msg, 1): + g_msg = '\n' + reward + if game_type is 'expert' reward := gained_petal(msg, 2): + g_msg = '\n' + reward await msg.finish(format_board(board) + '\n' + msg.locale.t('tic_tac_toe.message.winner', winner='X' if winner == 1 else 'O') + g_msg, quote=False)