@ Override public int getChatMembersCount ( ChatId chat_id ) throws IOException { AnalyticsData data = new AnalyticsData ( "getChatMembersCount" ) ; IOException ioException = null ; int membersCount = 0 ; data . setValue ( "chat_id" , chat_id ) ; try { membersCount = bot . getChatMembersCount ( chat_id ) ; data . setReturned ( membersCount ) ; } catch ( IOException e ) { ioException = e ; data . setIoException ( ioException ) ; } analyticsWorker . putData ( data ) ; if ( ioException != null ) { throw ioException ; } return membersCount ; }
Use this method to get the number of members in a chat .