From 0db975d80d064d0a5a52e2fbe22a0cf89160df3d8009fd16f4cfd4abbcb56f08 Mon Sep 17 00:00:00 2001 From: Crystal Date: Thu, 24 Jul 2025 00:05:05 +0200 Subject: [PATCH 1/3] get name from telegram --- bot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot.py b/bot.py index 825a3e1..8a6a6a1 100644 --- a/bot.py +++ b/bot.py @@ -42,11 +42,11 @@ async def echo(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None: await update.message.reply_text(_botsyms.WIP_MSG) async def add_player(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None: - player= 'XXX' #XXX implement me, get from user request + name= " ".join(context.args) print(f'sto aggiungendo il giocatore {player} all\'arena') _brsim.BrSimArena Arena= context.application.bot_data['arena'] - Arena.add_player(player) + Arena.add_player(name) print(f'Giocatori: {Arena.get_players()}') print(f'Ecco il mondo di gioco, questi sono i giocatori: {Arena.get_players()}') From 1ade636a592f861ddaaf271ac6857e1f423cd0fb7ec565fb94fd9e369f1ba8bc Mon Sep 17 00:00:00 2001 From: Crystal Date: Thu, 24 Jul 2025 00:06:13 +0200 Subject: [PATCH 2/3] typo --- bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot.py b/bot.py index 8a6a6a1..b3ace03 100644 --- a/bot.py +++ b/bot.py @@ -43,7 +43,7 @@ async def echo(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None: async def add_player(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None: name= " ".join(context.args) - print(f'sto aggiungendo il giocatore {player} all\'arena') + print(f'sto aggiungendo il giocatore {name} all\'arena') _brsim.BrSimArena Arena= context.application.bot_data['arena'] Arena.add_player(name) From eb592579a0c25f6e4e2dabb20fab9a8a7c8147678887479a81cca8d026a6c016 Mon Sep 17 00:00:00 2001 From: Crystal Date: Thu, 24 Jul 2025 00:08:03 +0200 Subject: [PATCH 3/3] message to telegram --- bot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot.py b/bot.py index b3ace03..ae70c3b 100644 --- a/bot.py +++ b/bot.py @@ -48,7 +48,7 @@ async def add_player(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None Arena= context.application.bot_data['arena'] Arena.add_player(name) print(f'Giocatori: {Arena.get_players()}') - print(f'Ecco il mondo di gioco, questi sono i giocatori: {Arena.get_players()}') + await update.message.reply_text(f'Ecco i giocatori presenti nel mondo do gioco: \n{Arena.get_players()}') def main():