Interface LongPollingBot
-
public interface LongPollingBot- Version:
- 1.0
- Author:
- Ruben Bermudez
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidclearWebhook()Clear current webhook (if present) calling setWebhook method with empty url.StringgetBotToken()Return bot token to access Telegram APIStringgetBotUsername()Return bot username of this botBotOptionsgetOptions()Gets options for current botdefault voidonClosing()Called when the BotSession is being closedvoidonUpdateReceived(Update update)This method is called when receiving updates via GetUpdates methoddefault voidonUpdatesReceived(List<Update> updates)This method is called when receiving updates via GetUpdates method.
-
-
-
Method Detail
-
onUpdateReceived
void onUpdateReceived(Update update)
This method is called when receiving updates via GetUpdates method- Parameters:
update- Update received
-
onUpdatesReceived
default void onUpdatesReceived(List<Update> updates)
This method is called when receiving updates via GetUpdates method. If not reimplemented - it just sends updates by one intoonUpdateReceived(Update)- Parameters:
updates- list of Update received
-
getBotUsername
String getBotUsername()
Return bot username of this bot
-
getBotToken
String getBotToken()
Return bot token to access Telegram API
-
getOptions
BotOptions getOptions()
Gets options for current bot- Returns:
- BotOptions object with options information
-
clearWebhook
void clearWebhook() throws TelegramApiRequestExceptionClear current webhook (if present) calling setWebhook method with empty url.- Throws:
TelegramApiRequestException
-
onClosing
default void onClosing()
Called when the BotSession is being closed
-
-