Ask login parameters explicitly

This commit is contained in:
Andrea Cavalli 2021-09-28 00:20:54 +02:00
parent ff712809b5
commit a4393e2769
1 changed files with 6 additions and 0 deletions

View File

@ -32,6 +32,12 @@ final class AuthorizationStateWaitAuthenticationDataHandler implements GenericUp
public void onUpdate(UpdateAuthorizationState update) {
if (update.authorizationState.getConstructor() == TdApi.AuthorizationStateWaitPhoneNumber.CONSTRUCTOR) {
AuthenticationData authenticationData = authenticable.getAuthenticationData();
// Ask login parameters
if (authenticationData instanceof ConsoleInteractiveAuthenticationData) {
((ConsoleInteractiveAuthenticationData) authenticationData).askData();
}
if (authenticationData.isBot()) {
String botToken = authenticationData.getBotToken();
TdApi.CheckAuthenticationBotToken response = new TdApi.CheckAuthenticationBotToken(botToken);