My Telegram bot logs all inline queries, including non-selected ones. How can I log solely the chosen result? Example code:
def process_chosen_inline(bot_service, update_obj):
user_handle = update_obj.inline_query.from_user.username
query_str = update_obj.inline_query.query
if not query_str:
return
articles = [
InlineQueryResultArticle(
id=query_str[::-1],
title="Reverse Text",
input_message_content=InputTextMessageContent(query_str[::-1])
)
]
bot_service.answerInlineQuery(update_obj.inline_query.id, articles)
custom_logger.info(f"{user_handle} selected an inline option")