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 implements
LongPollingBot
. It delegates all updates to a DefaultAbsSender
instance.- Author:
- Abbas Abou Daya
-
Field Summary
Fields inherited from class org.telegram.abilitybots.api.bot.BaseAbilityBot
ADMINS, BLACKLIST, db, DEFAULT, sender, silent, STATS, USER_ID, USERS
Fields inherited from class org.telegram.telegrambots.bots.DefaultAbsSender
exe
-
Constructor Summary
ModifierConstructorDescriptionprotected
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
Modifier and TypeMethodDescriptionvoid
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, 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, execute, executeAsync, executeAsync, executeAsync, executeAsync, executeAsync, executeAsync, executeAsync, executeAsync, executeAsync, executeAsync, executeAsync, executeAsync, executeAsync, executeAsync, executeAsync, executeAsync, getBaseUrl, getBotToken, 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
Methods inherited from interface org.telegram.telegrambots.meta.generics.LongPollingBot
getOptions, onClosing, onUpdatesReceived
Methods inherited from interface org.telegram.telegrambots.meta.generics.TelegramBot
getBotToken, getBotUsername, onRegister
-
Constructor Details
-
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
-
AbilityBot
-
AbilityBot
-
AbilityBot
-
AbilityBot
-
AbilityBot
-
-
Method Details
-
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
-