Package org.telegram.abilitybots.api.bot
Class AbilityBot
- java.lang.Object
-
- org.telegram.telegrambots.meta.bots.AbsSender
-
- org.telegram.telegrambots.bots.DefaultAbsSender
-
- org.telegram.abilitybots.api.bot.BaseAbilityBot
-
- org.telegram.abilitybots.api.bot.AbilityBot
-
- All Implemented Interfaces:
AbilityExtension
,org.telegram.telegrambots.meta.generics.LongPollingBot
,org.telegram.telegrambots.meta.generics.TelegramBot
public abstract class AbilityBot extends BaseAbilityBot implements org.telegram.telegrambots.meta.generics.LongPollingBot
The default AbilityBot class implementsLongPollingBot
. It delegates all updates to aDefaultAbsSender
instance.- Author:
- Abbas Abou Daya
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbilityBot(String botToken, String botUsername)
protected
AbilityBot(String botToken, String botUsername, DBContext db)
protected
AbilityBot(String botToken, String botUsername, DBContext db, AbilityToggle toggle)
protected
AbilityBot(String botToken, String botUsername, DBContext db, AbilityToggle toggle, DefaultBotOptions botOptions)
protected
AbilityBot(String botToken, String botUsername, DBContext db, DefaultBotOptions options)
protected
AbilityBot(String botToken, String botUsername, AbilityToggle toggle)
protected
AbilityBot(String botToken, String botUsername, AbilityToggle toggle, DefaultBotOptions options)
protected
AbilityBot(String botToken, String botUsername, DefaultBotOptions botOptions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearWebhook()
void
onUpdateReceived(org.telegram.telegrambots.meta.api.objects.Update update)
This method contains the stream of actions that are applied on any update.-
Methods inherited from class org.telegram.abilitybots.api.bot.BaseAbilityBot
abilities, addExtension, addExtensions, addExtensions, admins, allowContinuousText, blacklist, checkGlobalFlags, creatorId, db, getBotToken, getBotUsername, getCommandPrefix, getCommandRegexSplit, getPrivacy, isAdmin, isCreator, isGroupAdmin, isGroupAdmin, onRegister, replies, sender, silent, stats, userIds, users
-
Methods inherited from class org.telegram.telegrambots.bots.DefaultAbsSender
downloadFile, downloadFile, downloadFile, downloadFile, downloadFileAsStream, downloadFileAsStream, downloadFileAsync, downloadFileAsync, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, executeAsync, executeAsync, executeAsync, executeAsync, executeAsync, executeAsync, executeAsync, executeAsync, executeAsync, executeAsync, executeAsync, executeAsync, executeAsync, executeAsync, executeAsync, getBaseUrl, getOptions, sendApiMethod, sendApiMethodAsync, sendApiMethodAsync
-
Methods inherited from class org.telegram.telegrambots.meta.bots.AbsSender
execute, executeAsync, executeAsync, getMe, getMeAsync, getMeAsync, getWebhookInfo, getWebhookInfoAsync, getWebhookInfoAsync
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Constructor Detail
-
AbilityBot
protected AbilityBot(String botToken, String botUsername, DBContext db, AbilityToggle toggle, DefaultBotOptions botOptions)
-
AbilityBot
protected AbilityBot(String botToken, String botUsername, AbilityToggle toggle, DefaultBotOptions options)
-
AbilityBot
protected AbilityBot(String botToken, String botUsername, DBContext db, AbilityToggle toggle)
-
AbilityBot
protected AbilityBot(String botToken, String botUsername, DBContext db, DefaultBotOptions options)
-
AbilityBot
protected AbilityBot(String botToken, String botUsername, DefaultBotOptions botOptions)
-
AbilityBot
protected AbilityBot(String botToken, String botUsername, AbilityToggle toggle)
-
-
Method Detail
-
onUpdateReceived
public void onUpdateReceived(org.telegram.telegrambots.meta.api.objects.Update update)
Description copied from class:BaseAbilityBot
This method contains the stream of actions that are applied on any update.It will correctly handle addition of users into the DB and the execution of abilities and replies.
- Specified by:
onUpdateReceived
in interfaceorg.telegram.telegrambots.meta.generics.LongPollingBot
- Overrides:
onUpdateReceived
in classBaseAbilityBot
- Parameters:
update
- the update received by Telegram's API
-
clearWebhook
public void clearWebhook() throws org.telegram.telegrambots.meta.exceptions.TelegramApiRequestException
- Specified by:
clearWebhook
in interfaceorg.telegram.telegrambots.meta.generics.LongPollingBot
- Throws:
org.telegram.telegrambots.meta.exceptions.TelegramApiRequestException
-
-