A
A
Anton Anton2021-01-13 22:02:54
Python
Anton Anton, 2021-01-13 22:02:54

How to get the user ID from the message text in discord?

Hello! Guys, tell me who knows, I have a simple discordbot on Python. The task is the following, it is necessary that the bot respond only when the user accesses it. In the on_message event of a message, for example, the following "<@!798919118224490496> Hello!" As I understand it, the ID is enclosed in special characters, is there some method, maybe, that will allow me to understand that the appeal goes specifically to the bot?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey, 2021-01-13
@monolitHC

https://discordpy.readthedocs.io/en/latest/api.htm...
Just see if they have your bot

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question