public class RegistrableTelegramBot extends TelegramBot
| Modifier and Type | Class and Description |
|---|---|
static interface |
RegistrableTelegramBot.MessageListener |
| Constructor and Description |
|---|
RegistrableTelegramBot(String botToken) |
RegistrableTelegramBot(String botToken,
boolean async) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
notifyNewMessages(List<Message> messages)
This method is called by this class to process all new
Messages asynchronously. |
protected ExecutorService |
provideExecutorService()
Instantiates and returns an
ExecutorService. |
void |
register(RegistrableTelegramBot.MessageListener messageListener) |
void |
unregister(RegistrableTelegramBot.MessageListener messageListener) |
forwardMessage, getMe, getUserProfilePhotos, getUserProfilePhotos, onMessage, onStart, onStop, replyTo, sendAudio, sendAudio, sendAudio, sendAudio, sendChatAction, sendDocument, sendDocument, sendDocument, sendDocument, sendLocation, sendLocation, sendMessage, sendMessage, sendPhoto, sendPhoto, sendPhoto, sendPhoto, sendSticker, sendSticker, sendSticker, sendSticker, sendVideo, sendVideo, sendVideo, sendVideo, sendVoice, sendVoice, sendVoice, sendVoice, start, stoppublic RegistrableTelegramBot(String botToken)
public RegistrableTelegramBot(String botToken, boolean async)
public void register(RegistrableTelegramBot.MessageListener messageListener)
public void unregister(RegistrableTelegramBot.MessageListener messageListener)
protected ExecutorService provideExecutorService()
TelegramBotExecutorService.
By default, Executors.newCachedThreadPool() is used.
This method can safely be overridden to adjust this behaviour.
This method can safely be overridden to return null, but if you decide to do so, TelegramBot.notifyNewMessages(List)
must be overridden to avoid a NPE.provideExecutorService in class TelegramBotExecutorServiceprotected void notifyNewMessages(List<Message> messages)
TelegramBotMessages asynchronously.
It must be overridden if TelegramBot.provideExecutorService() is overridden to return null, otherwise
a NullPointerException may be thrown.notifyNewMessages in class TelegramBotmessages - The newly arrived Messages