Package org.telegram.telegrambots.meta
Class TelegramBotsApi
- java.lang.Object
-
- org.telegram.telegrambots.meta.TelegramBotsApi
-
public class TelegramBotsApi extends Object
- Version:
- 1.0
- Author:
- Ruben Bermudez
-
-
Constructor Summary
Constructors Constructor Description TelegramBotsApi()TelegramBotsApi(String externalUrl, String internalUrl)Creates an HTTP server to receive webhook requestTelegramBotsApi(String keyStore, String keyStorePassword, String externalUrl, String internalUrl)Creates an HTTPS server to receive webhook requestTelegramBotsApi(String keyStore, String keyStorePassword, String externalUrl, String internalUrl, String pathToCertificate)Creates an HTTPS server with self-signed certificate to receive webhook request
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BotSessionregisterBot(LongPollingBot bot)Register a bot.voidregisterBot(WebhookBot bot)Register a bot in the api that will receive updates using webhook method
-
-
-
Constructor Detail
-
TelegramBotsApi
public TelegramBotsApi()
-
TelegramBotsApi
public TelegramBotsApi(String externalUrl, String internalUrl) throws TelegramApiRequestException
Creates an HTTP server to receive webhook request- Parameters:
externalUrl- External base url for the webhookinternalUrl- Internal base url for the webhook- Throws:
TelegramApiRequestException
-
TelegramBotsApi
public TelegramBotsApi(String keyStore, String keyStorePassword, String externalUrl, String internalUrl) throws TelegramApiRequestException
Creates an HTTPS server to receive webhook request- Parameters:
keyStore- KeyStore for the serverkeyStorePassword- Key store password for the serverexternalUrl- External base url for the webhookinternalUrl- Internal base url for the webhook- Throws:
TelegramApiRequestException
-
TelegramBotsApi
public TelegramBotsApi(String keyStore, String keyStorePassword, String externalUrl, String internalUrl, String pathToCertificate) throws TelegramApiRequestException
Creates an HTTPS server with self-signed certificate to receive webhook request- Parameters:
keyStore- KeyStore for the serverkeyStorePassword- Key store password for the serverexternalUrl- External base url for the webhookinternalUrl- Internal base url for the webhookpathToCertificate- Full path until .pem public certificate keys- Throws:
TelegramApiRequestException
-
-
Method Detail
-
registerBot
public BotSession registerBot(LongPollingBot bot) throws TelegramApiRequestException
Register a bot. The Bot Session is started immediately, and may be disconnected by calling close.- Parameters:
bot- the bot to register- Throws:
TelegramApiRequestException
-
registerBot
public void registerBot(WebhookBot bot) throws TelegramApiRequestException
Register a bot in the api that will receive updates using webhook method- Parameters:
bot- Bot to register- Throws:
TelegramApiRequestException
-
-