public class TelegramBotsApi extends Object
Constructor and Description |
---|
TelegramBotsApi() |
TelegramBotsApi(String externalUrl,
String internalUrl)
Creates an HTTP server to receive webhook request
|
TelegramBotsApi(String keyStore,
String keyStorePassword,
String externalUrl,
String internalUrl)
Creates an HTTPS server to receive webhook request
|
TelegramBotsApi(String keyStore,
String keyStorePassword,
String externalUrl,
String internalUrl,
String pathToCertificate)
Creates an HTTPS server with self-signed certificate to receive webhook request
|
Modifier and Type | Method and Description |
---|---|
BotSession |
registerBot(LongPollingBot bot)
Register a bot.
|
void |
registerBot(WebhookBot bot)
Register a bot in the api that will receive updates using webhook method
|
public TelegramBotsApi()
public TelegramBotsApi(String externalUrl, String internalUrl) throws TelegramApiRequestException
externalUrl
- External base url for the webhookinternalUrl
- Internal base url for the webhookTelegramApiRequestException
public TelegramBotsApi(String keyStore, String keyStorePassword, String externalUrl, String internalUrl) throws TelegramApiRequestException
keyStore
- KeyStore for the serverkeyStorePassword
- Key store password for the serverexternalUrl
- External base url for the webhookinternalUrl
- Internal base url for the webhookTelegramApiRequestException
public TelegramBotsApi(String keyStore, String keyStorePassword, String externalUrl, String internalUrl, String pathToCertificate) throws TelegramApiRequestException
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 keysTelegramApiRequestException
public BotSession registerBot(LongPollingBot bot) throws TelegramApiRequestException
bot
- the bot to registerTelegramApiRequestException
public void registerBot(WebhookBot bot) throws TelegramApiRequestException
bot
- Bot to registerTelegramApiRequestException
Copyright © 2018. All rights reserved.