EvanLee
EvanLee

Reputation: 49

get the count of telegram group members

I try like that

GetChatMemberCount chatMemberCount = new GetChatMemberCount().setChatId(message.getChatId()); 
Integer count = chatMemberCount.deserializeResponse("false");

But there were excepetion

'Cannot construct instance of org.telegram.telegrambots.api.objects.replykeyboard.ApiResponse (although at least one Creator exists): no boolean/Boolean-argument constructor/factory method to deserialize from boolean value (false)'.

Upvotes: 2

Views: 1189

Answers (1)

EvanLee
EvanLee

Reputation: 49

By this way, I get the count of the group members.

GetChatMemberCount chatMemberCount = new GetChatMemberCount().setChatId(message.getChatId());
try { Integer count = execute(chatMemberCount); } catch (TelegramApiException e) { logger.error(e.getMessage()); }

Upvotes: 1

Related Questions