G
G
Gospodin_Kiroshi2021-10-11 16:41:11
Python
Gospodin_Kiroshi, 2021-10-11 16:41:11

How do I get the bot to mention the user when replying? (Airogram)?

There is code
elif msg.text.lower() == "hello everyone":
await msg.answer('Hello')

In fact, you can do it just as a reply to a message, but I would like to make it mention the person by name. (Hello, Ivan!) And of course, a link to the profile

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
pozner88, 2021-10-11
@Gospodin_Kiroshi

It is necessary to add what he should answer

await msg.answer('Привет '+str(msg.from_user.username))

In this case, it will send (Hi, username of the person who sent the message). Or you can replace username with first_name, last_name, full_name

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question