T
T
Thymomenos Gata2017-05-22 03:46:45
Java
Thymomenos Gata, 2017-05-22 03:46:45

How to determine the username type?

Hello everyone, I am writing a bot in java for telegram . The bot is almost ready and, in principle, it can already be uploaded to the server so that it works, but there was a problem with username .
The problem is, in tg, you can call a person by username, but you can also invite a person to a chat / channel by username. How can you determine the type of username so that the bot understands whether it is a chat, a channel or a user?
Tried like this: but it gives an answer to any username: mention If anyone knows, tell me plz, is it possible to solve this problem?
message.getEntities().get(0).getType();

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