L
L
LordeckiyDavid2022-01-25 22:04:29
JavaScript
LordeckiyDavid, 2022-01-25 22:04:29

How to get username from a message?

Hello.
I decided to make myself a bot for my group with the usual functionality /ban /warn /kick, etc.
But the question arose:
The administrator writes the command "/warn @username", how can I get exactly '@username', which is in this message, so that later I can get the id from it and manipulate it.
I understand that you need to get the message "ctx.message.text", it displays the text itself, I display it (screenshot), and then how to get the username?
61f049af38416501377300.png
Thanks in advance to everyone who answers

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question