Answer the question
In order to leave comments, you need to log in
How to check if a user is in a telegram chat in spring?
I know the user and chat id, but it gives out:
at org.telegram.telegrambots.meta.api.methods.groupadministration.GetChatMember.deserializeResponse(GetChatMember.java:73)
at org.telegram.telegrambots.meta.api.methods.groupadministration.GetChatMember.deserializeResponse(GetChatMember.java:21)
at org.telegram.telegrambots.bots.DefaultAbsSender.sendApiMethod(DefaultAbsSender.java:725)
at org.telegram.telegrambots.meta.bots.AbsSender.execute(AbsSender.java:47)
GetChatMember getMember = new GetChatMember();
getMember.setUserId(user.getId());
ChatMember theChatMember;
for (Channel c : channels) {
getMember.setChatId(c.getId());
theChatMember = execute(getMember);
if ("left".equalsIgnoreCase(theChatMember.getStatus())) {
return false;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question