public abstract class LongPollingBot extends TelegramBot implements java.lang.AutoCloseable
bot, events| Constructor and Description |
|---|
LongPollingBot(Bot bot)
Constructs a long polling bot with 500 milliseconds of back off.
|
LongPollingBot(Bot bot,
java.util.logging.Logger logger)
Constructs a long polling bot.
|
LongPollingBot(Bot bot,
java.util.function.LongUnaryOperator backOff)
Constructs a long polling bot.
|
LongPollingBot(Bot bot,
java.util.function.LongUnaryOperator backOff,
java.util.logging.Logger logger)
Constructs a long polling bot.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
onError(java.lang.Throwable t)
Handles an exception occurred while receiving or handling updates.
|
void |
run() |
onUpdatepublic LongPollingBot(Bot bot, java.util.function.LongUnaryOperator backOff, java.util.logging.Logger logger)
bot - the bot used by the readerbackOff - back off to be used when long polling failslogger - optional loggerpublic LongPollingBot(Bot bot, java.util.logging.Logger logger)
bot - the bot used by the readerlogger - optional loggerpublic LongPollingBot(Bot bot, java.util.function.LongUnaryOperator backOff)
bot - the bot used by the readerbackOff - back off to be used when long polling failspublic LongPollingBot(Bot bot)
bot - the bot used by the readerpublic void run()
run in interface java.lang.Runnablepublic void onError(java.lang.Throwable t)
t - the exception to handlepublic void close()
throws java.io.IOException
close in interface java.lang.AutoCloseablejava.io.IOException