Answer the question
In order to leave comments, you need to log in
I can't display the user's nickname in the bot?
They wrote me a bot to order, I want it to display not only the Name + Text, but also the user's Nickname, if it is installed. It’s just that when a nickname is written in a message from a bot, he receives a notification that you were mentioned in the chat, and if just a name is written, then nothing comes. My programmer is out of touch. Help me please.
"""Если пользователя нет в списке, то отправляет сообщение 'имя + текст' из файла message.txt. """
text = get_message() # Получает сообщение из файла
bot_message = await message.answer(text=f'{message.from_user.first_name}, {text}', parse_mode='HTML')
"""Если пользователя нет в списке, то отправляет сообщение 'имя + текст' из файла message.txt. """
text = get_message() # Получает сообщение из файла
bot_message = await message.answer(text=f'{message.from_user.first_name},{message.from_user.username}, {text}', parse_mode='HTML')
"""Если пользователя нет в списке, то отправляет сообщение 'имя + текст' из файла message.txt. """
text = get_message() # Получает сообщение из файла
bot_message = await message.answer(text=f'{message.from_user.username}, {text}', parse_mode='HTML')
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question