Class TelegramBotsWebhookApplication
Object
TelegramBotsWebhookApplication
- All Implemented Interfaces:
AutoCloseable
- Version:
- 1.0
- Author:
- Ruben Bermudez
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()booleanvoidregisterBot(String botPath, Function<Update, BotApiMethod<?>> updateHandler, Runnable setWebhook, Runnable deleteWebhook) Use this method to register a new bot in the webhook servervoidregisterBot(TelegramWebhookBot telegramWebhookBot) Use this method to register a new bot in the webhook servervoidstart()voidstop()voidunregisterBot(String botPath) Use this method to unregister a bot in the webhook servervoidunregisterBot(TelegramWebhookBot telegramWebhookBot) Use this method to unregister a bot in the webhook server
-
Constructor Details
-
TelegramBotsWebhookApplication
- Throws:
TelegramApiException
-
TelegramBotsWebhookApplication
- Throws:
TelegramApiException
-
-
Method Details
-
registerBot
public void registerBot(String botPath, Function<Update, BotApiMethod<?>> updateHandler, Runnable setWebhook, Runnable deleteWebhook) throws TelegramApiExceptionUse this method to register a new bot in the webhook server- Parameters:
botPath- New Bot to registerupdateHandler- New Bot to registersetWebhook- New Bot to registerdeleteWebhook- New Bot to register- Throws:
TelegramApiException
-
unregisterBot
Use this method to unregister a bot in the webhook server- Parameters:
botPath- BotPath to unregister- Throws:
TelegramApiException
-
registerBot
Use this method to register a new bot in the webhook server- Parameters:
telegramWebhookBot- New Bot to register- Throws:
TelegramApiException
-
unregisterBot
Use this method to unregister a bot in the webhook server- Parameters:
telegramWebhookBot- Bot to unregister- Throws:
TelegramApiException
-
isRunning
public boolean isRunning() -
start
- Throws:
TelegramApiException
-
stop
- Throws:
TelegramApiException
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
TelegramApiException
-