2016-11-17 02:41:12 +01:00
|
|
|
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;
|
2018-07-27 01:06:23 +02:00
|
|
|
import org.telegram.telegrambots.util.WebhookUtils;
|
2016-11-17 02:41:12 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @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
|
2016-11-17 02:41:12 +01:00
|
|
|
* <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());
|
2016-11-17 02:41:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public TelegramLongPollingBot(DefaultBotOptions options) {
|
|
|
|
super(options);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void clearWebhook() throws TelegramApiRequestException {
|
2018-06-04 10:47:21 +02:00
|
|
|
WebhookUtils.clearWebhook(this);
|
2016-11-17 02:41:12 +01:00
|
|
|
}
|
2017-11-21 20:14:12 +01:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onClosing() {
|
|
|
|
exe.shutdown();
|
|
|
|
}
|
2018-06-04 10:47:21 +02:00
|
|
|
}
|