tdlight-java/src/main/java/it/tdlight/client/AuthenticationData.java

29 lines
591 B
Java
Raw Normal View History

2021-09-27 19:27:13 +02:00
package it.tdlight.client;
public interface AuthenticationData {
2021-09-27 19:27:13 +02:00
2021-09-27 22:15:17 +02:00
boolean isQrCode();
boolean isBot();
2021-09-27 19:27:13 +02:00
long getUserPhoneNumber();
2021-09-27 19:27:13 +02:00
String getBotToken();
2021-09-27 19:27:13 +02:00
2021-09-27 22:15:17 +02:00
static AuthenticationData qrCode() {
return new AuthenticationDataQrCode();
}
static AuthenticationData user(long userPhoneNumber) {
return new AuthenticationDataImpl(userPhoneNumber, null);
2021-09-27 19:27:13 +02:00
}
static AuthenticationData bot(String botToken) {
return new AuthenticationDataImpl(null, botToken);
2021-09-27 19:27:13 +02:00
}
2021-10-24 00:33:57 +02:00
static ConsoleInteractiveAuthenticationData consoleLogin() {
return new ConsoleInteractiveAuthenticationData();
2021-09-27 19:27:13 +02:00
}
}