Class TelegramBotsLongPollingApplication
Object
TelegramBotsLongPollingApplication
- All Implemented Interfaces:
AutoCloseable
-
Constructor Summary
ConstructorsConstructorDescriptionTelegramBotsLongPollingApplication(Supplier<ObjectMapper> objectMapperSupplier) TelegramBotsLongPollingApplication(Supplier<ObjectMapper> objectMapperSupplier, Supplier<OkHttpClient> okHttpClientCreator) TelegramBotsLongPollingApplication(Supplier<ObjectMapper> objectMapperSupplier, Supplier<OkHttpClient> okHttpClientCreator, Supplier<ScheduledExecutorService> executorSupplier) TelegramBotsLongPollingApplication(Supplier<ObjectMapper> objectMapperSupplier, Supplier<OkHttpClient> okHttpClientCreator, Supplier<ScheduledExecutorService> executorSupplier, Supplier<BackOff> backOffSupplier) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()booleanregisterBot(String botToken, Supplier<TelegramUrl> telegramUrlSupplier, Function<Integer, GetUpdates> getUpdatesGenerator, LongPollingUpdateConsumer updatesConsumer) registerBot(String botToken, LongPollingUpdateConsumer updatesConsumer) voidstart()voidstop()voidunregisterBot(String botToken)
-
Constructor Details
-
TelegramBotsLongPollingApplication
public TelegramBotsLongPollingApplication() -
TelegramBotsLongPollingApplication
-
TelegramBotsLongPollingApplication
-
TelegramBotsLongPollingApplication
public TelegramBotsLongPollingApplication(Supplier<ObjectMapper> objectMapperSupplier, Supplier<OkHttpClient> okHttpClientCreator, Supplier<ScheduledExecutorService> executorSupplier) -
TelegramBotsLongPollingApplication
-
-
Method Details
-
registerBot
public BotSession registerBot(String botToken, LongPollingUpdateConsumer updatesConsumer) throws TelegramApiException - Throws:
TelegramApiException
-
registerBot
public BotSession registerBot(String botToken, Supplier<TelegramUrl> telegramUrlSupplier, Function<Integer, GetUpdates> getUpdatesGenerator, LongPollingUpdateConsumer updatesConsumer) throws TelegramApiException- Throws:
TelegramApiException
-
unregisterBot
- Throws:
TelegramApiException
-
isRunning
public boolean isRunning() -
start
- Throws:
TelegramApiException
-
stop
- Throws:
TelegramApiException
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-