explicit logs

This commit is contained in:
andrea
2025-07-26 21:25:38 +02:00
parent 460a6ccdec
commit 8f3d6dfaff
5 changed files with 38 additions and 42 deletions

View File

@@ -1,12 +1,14 @@
import debug as _dbg
from utils import logs as _log
def get_winner(context, Arena):
def get_winner(context, Arena, chat_id):
winner= Arena.get_alive_players()[0]
try:
context.job.schedule_removal()
_log.log_info(f'simulate_day: Loop removed')
_log.log_info(f'simulate_day: {chat_id} Loop removed')
except: pass
msg= f'{winner.get_name_and_stats()} Vince la cruenta battaglia '
msg+= f'uccidendo {winner.get_kills()} giocatori '
msg+= f'e schivando {winner.get_dodges()} colpi nemici, e vive felice e '
@@ -18,9 +20,10 @@ def get_winner(context, Arena):
msg+= 'content# con Guarino'
return msg
async def simulate_day(context, chat_id):
if 'arena' not in context.application.bot_data:
_log.log_info('Arena not Found')
_log.log_info('simulate_day: {chat_id} Arena not Found')
await context.bot.send_message(chat_id, 'Che e\' successo? un Guarino ha rubato l\'arena, avvia una nuova partita con /start')
return
@@ -34,5 +37,5 @@ async def simulate_day(context, chat_id):
msg= Arena.get_ranking()
await context.bot.send_message(chat_id, msg)
if len(Arena.get_alive_players()) == 1:
msg= get_winner(context, Arena)
msg= get_winner(context, Arena, chat_id)
return await context.bot.send_message(chat_id, msg)