public Chat getChat ( String chatID ) { try { MultipartBody request = Unirest . post ( getBotAPIUrl ( ) + "getChat" ) . field ( "chat_id" , chatID , "application/json; charset=utf8;" ) ; HttpResponse < String > response = request . asString ( ) ; JSONObject jsonResponse = Utils . processResponse ( response ) ; if ( jsonResponse != null && Utils . checkResponseStatus ( jsonResponse ) ) { JSONObject result = jsonResponse . getJSONObject ( "result" ) ; return ChatImpl . createChat ( result , this ) ; } } catch ( UnirestException e ) { e . printStackTrace ( ) ; } return null ; }
A method used to get a Chat object via the chats ID