@ Override public ChatMember [ ] getChatAdministrators ( ChatId chat_id ) throws IOException { AnalyticsData data = new AnalyticsData ( "getChatAdministrators" ) ; IOException ioException = null ; ChatMember [ ] admins = null ; data . setValue ( "chat_id" , chat_id ) ; try { admins = bot . getChatAdministrators ( chat_id ) ; data . setReturned ( admins ) ; } catch ( IOException e ) { ioException = e ; data . setIoException ( ioException ) ; } analyticsWorker . putData ( data ) ; if ( ioException != null ) { throw ioException ; } return admins ; }
Use this method to get a list of administrators in a chat .