protected int getUserIdSendError ( String username , MessageContext ctx ) { try { return getUser ( username ) . getId ( ) ; } catch ( IllegalStateException ex ) { silent . send ( getLocalizedMessage ( USER_NOT_FOUND , ctx . user ( ) . getLanguageCode ( ) , username ) , ctx . chatId ( ) ) ; throw propagate ( ex ) ; } }
Gets the user with the specified username . If user was not found the bot will send a message on Telegram .