Fix phone number parsing
This commit is contained in:
parent
73d9d977cc
commit
d0992fa7a9
@ -25,7 +25,7 @@
|
||||
<dependency>
|
||||
<groupId>it.tdlight</groupId>
|
||||
<artifactId>tdlight-java</artifactId>
|
||||
<version>2.7.8.20</version>
|
||||
<version>2.7.8.21</version>
|
||||
</dependency>
|
||||
|
||||
<!-- TDLight natives -->
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user