Fix phone number parsing
This commit is contained in:
parent
73d9d977cc
commit
d0992fa7a9
@ -25,7 +25,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>it.tdlight</groupId>
|
<groupId>it.tdlight</groupId>
|
||||||
<artifactId>tdlight-java</artifactId>
|
<artifactId>tdlight-java</artifactId>
|
||||||
<version>2.7.8.20</version>
|
<version>2.7.8.21</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- TDLight natives -->
|
<!-- TDLight natives -->
|
||||||
|
@ -98,11 +98,7 @@ final class ConsoleInteractiveAuthenticationData implements AuthenticationData {
|
|||||||
phoneNumber = ScannerUtils.askParameter("login", "Please type your phone number");
|
phoneNumber = ScannerUtils.askParameter("login", "Please type your phone number");
|
||||||
} while (phoneNumber.length() < 3);
|
} while (phoneNumber.length() < 3);
|
||||||
|
|
||||||
long phoneNumberLong = Long.parseLong(phoneNumber.chars().filter(Character::isDigit).boxed().collect(Collector.of(
|
long phoneNumberLong = Long.parseLong(phoneNumber.replaceAll("[\\D]", ""));
|
||||||
StringBuilder::new,
|
|
||||||
StringBuilder::append,
|
|
||||||
StringBuilder::append,
|
|
||||||
StringBuilder::toString)));
|
|
||||||
|
|
||||||
this.isBot = false;
|
this.isBot = false;
|
||||||
this.phoneNumber = phoneNumberLong;
|
this.phoneNumber = phoneNumberLong;
|
||||||
|
Loading…
Reference in New Issue
Block a user