Answer the question
In order to leave comments, you need to log in
How to get the username of a user in aiogram?
How to get the username of the user who wrote the command. I want to output it to the console.
I use aiogram
Answer the question
In order to leave comments, you need to log in
@dp.message_handler(commands=['start'], state='*')
async def start(msg: types.Message):
await bot.send_message(msg.from_user.id, msg.from_user.first_name)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question