M
M
Max0208992021-05-05 18:59:55
Python
Max020899, 2021-05-05 18:59:55

How to display username and bot name in Python?

Hello, can you tell me how to display the user name (first.name) and the bot name in the message? I am using the aiogram library.
I used teleBot before, so it will look like this:

bot.send_message(message.chat.id, "Привет, {0.first_name}! \n Я - {1.first_name}</b>,
parse_mode='html', reply_markup=markup)

Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2021-05-05
@SoreMix

message.from_user.last_name
message.from_user.first_name

bot.get_me().first_name

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question