N
N
Nikita K2020-11-15 03:45:42
Java
Nikita K, 2020-11-15 03:45:42

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)


My code:
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;
                    }


How can I get chatMember?

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