N
N
Nikita K2020-11-09 19:26:28
Java
Nikita K, 2020-11-09 19:26:28

How to check if a user is in a telegram chat?

I need to check if the user is in chats (several chats), I don’t understand how to create the Chat variable by chatId

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikita K, 2020-11-11
@yung_filosof

Here is what I dug up

GetChatMember getMember = new GetChatMember();
getMember.setChatId(the_id_of_the_chat); //like the id of the group
getMember.setUserId(user_id); //the id of the specific user

//since the API method GetChatMember is returning a ChatMember object on succes, 
// you can try to retrieve it
ChatMember theChatMember = execute(getMember);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question