Class DefaultTokenValidator
java.lang.Object
io.micronaut.chatbots.telegram.core.DefaultTokenValidator
- All Implemented Interfaces:
TokenValidator
- Since:
- 1.0.0
- Author:
- Sergio del Amo
-
Field Summary
Fields inherited from interface io.micronaut.chatbots.telegram.core.TokenValidator
X_TELEGRAM_BOT_API_SECRET_TOKEN
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
DefaultTokenValidator
-
-
Method Details
-
validate
@NonNull public @NonNull Optional<TelegramBotConfiguration> validate(@NonNull @NotBlank @NonNull @NotBlank String token) - Specified by:
validate
in interfaceTokenValidator
- Parameters:
token
- Telegram Token as returned by the Bot Father.- Returns:
- Returns the
TelegramBotConfiguration
associated to the token. If the token is not associated with any Telegram bot an empty optional is returned.
-