diff --git a/example/pom.xml b/example/pom.xml index 6786834..b6e917c 100644 --- a/example/pom.xml +++ b/example/pom.xml @@ -25,7 +25,7 @@ it.tdlight tdlight-java - 2.7.8.20 + 2.7.8.21 diff --git a/src/main/java/it/tdlight/client/ConsoleInteractiveAuthenticationData.java b/src/main/java/it/tdlight/client/ConsoleInteractiveAuthenticationData.java index 2f91774..6b7b776 100644 --- a/src/main/java/it/tdlight/client/ConsoleInteractiveAuthenticationData.java +++ b/src/main/java/it/tdlight/client/ConsoleInteractiveAuthenticationData.java @@ -98,11 +98,7 @@ final class ConsoleInteractiveAuthenticationData implements AuthenticationData { phoneNumber = ScannerUtils.askParameter("login", "Please type your phone number"); } while (phoneNumber.length() < 3); - long phoneNumberLong = Long.parseLong(phoneNumber.chars().filter(Character::isDigit).boxed().collect(Collector.of( - StringBuilder::new, - StringBuilder::append, - StringBuilder::append, - StringBuilder::toString))); + long phoneNumberLong = Long.parseLong(phoneNumber.replaceAll("[\\D]", "")); this.isBot = false; this.phoneNumber = phoneNumberLong;