Package org.telegram.telegrambots.meta
Class TelegramBotsApi
- java.lang.Object
-
- org.telegram.telegrambots.meta.TelegramBotsApi
-
public class TelegramBotsApi extends Object
- Version:
- 1.0 Bots manager
- Author:
- Ruben Bermudez
-
-
Constructor Summary
Constructors Constructor Description TelegramBotsApi(Class<? extends BotSession> botSessionClass)TelegramBotsApi(Class<? extends BotSession> botSessionClass, Webhook webhook)Creates an HTTP server 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, SetWebhook setWebhook)Register a bot in the api that will receive updates using webhook method
-
-
-
Constructor Detail
-
TelegramBotsApi
public TelegramBotsApi(Class<? extends BotSession> botSessionClass) throws TelegramApiException
- Throws:
TelegramApiException
-
TelegramBotsApi
public TelegramBotsApi(Class<? extends BotSession> botSessionClass, Webhook webhook) throws TelegramApiException
Creates an HTTP server to receive webhook request- Parameters:
webhook- Webhook class- Throws:
TelegramApiException
-
-
Method Detail
-
registerBot
public BotSession registerBot(LongPollingBot bot) throws TelegramApiException
Register a bot. The Bot Session is started immediately, and may be disconnected by calling close.- Parameters:
bot- the bot to register- Throws:
TelegramApiException
-
registerBot
public void registerBot(WebhookBot bot, SetWebhook setWebhook) throws TelegramApiException
Register a bot in the api that will receive updates using webhook method- Parameters:
bot- Bot to registersetWebhook- Set webhook request to initialize the bot- Throws:
TelegramApiException
-
-