bot log more user info

This commit is contained in:
andrea
2025-08-01 19:20:23 +02:00
parent c30c46e20f
commit 47729ceeb9

12
bot.py
View File

@@ -38,8 +38,18 @@ async def bot_start(update, context):
async def bot_commands(update, context):
text= update.message.text
chat_id = update.effective_chat.id
username= update.effective_chat.username
first_name= update.effective_chat.first_name
last_name= update.effective_chat.last_name
chat_type= update.effective_chat.type.name # PRIVAT|BOT|ETC..
_log.log_info(f'bot_command: {chat_id} - text received: {text}')
_log.log_info(f'bot_command: \
user id="{chat_id}" \
username="{username}" \
first_name="{first_name}" \
last_name="{last_name}" \
chat_type="{chat_type}"')
# init or restart the game
if text == 'Init/Restart':