TelegramBots/telegrambots/src/main/java/org/telegram/telegrambots/bots/TelegramLongPollingBot.java

31 lines
908 B
Java
Raw Normal View History

package org.telegram.telegrambots.bots;
2018-07-08 01:41:21 +02:00
import org.telegram.telegrambots.meta.exceptions.TelegramApiRequestException;
import org.telegram.telegrambots.meta.generics.LongPollingBot;
import org.telegram.telegrambots.util.WebhookUtils;
/**
* @author Ruben Bermudez
* @version 1.0
2017-10-11 19:27:12 +02:00
* Base abstract class for a bot that will get updates using
* <a href="https://core.telegram.org/bots/api#getupdates">long-polling</a> method
*/
public abstract class TelegramLongPollingBot extends DefaultAbsSender implements LongPollingBot {
public TelegramLongPollingBot() {
2020-11-03 03:57:36 +01:00
this(new DefaultBotOptions());
}
public TelegramLongPollingBot(DefaultBotOptions options) {
super(options);
}
@Override
public void clearWebhook() throws TelegramApiRequestException {
WebhookUtils.clearWebhook(this);
}
@Override
public void onClosing() {
exe.shutdown();
}
}