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

31 lines
908 B
Java

package org.telegram.telegrambots.bots;
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
* 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() {
this(new DefaultBotOptions());
}
public TelegramLongPollingBot(DefaultBotOptions options) {
super(options);
}
@Override
public void clearWebhook() throws TelegramApiRequestException {
WebhookUtils.clearWebhook(this);
}
@Override
public void onClosing() {
exe.shutdown();
}
}