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, USERSFields inherited from class org.telegram.telegrambots.bots.DefaultAbsSender
exe -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbilityBot(String botToken, String botUsername) protectedAbilityBot(String botToken, String botUsername, DBContext db) protectedAbilityBot(String botToken, String botUsername, DBContext db, AbilityToggle toggle) protectedAbilityBot(String botToken, String botUsername, DBContext db, AbilityToggle toggle, DefaultBotOptions botOptions) protectedAbilityBot(String botToken, String botUsername, DBContext db, DefaultBotOptions options) protectedAbilityBot(String botToken, String botUsername, AbilityToggle toggle) protectedAbilityBot(String botToken, String botUsername, AbilityToggle toggle, DefaultBotOptions options) protectedAbilityBot(String botToken, String botUsername, DefaultBotOptions botOptions) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidonUpdateReceived(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, usersMethods 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, getBotToken, getOptions, sendApiMethod, sendApiMethodAsync, sendApiMethodAsyncMethods inherited from class org.telegram.telegrambots.meta.bots.AbsSender
execute, executeAsync, executeAsync, getMe, getMeAsync, getMeAsync, getWebhookInfo, getWebhookInfoAsync, getWebhookInfoAsyncMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.telegram.telegrambots.meta.generics.LongPollingBot
getOptions, onClosing, onUpdatesReceivedMethods 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:BaseAbilityBotThis 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:
onUpdateReceivedin interfaceorg.telegram.telegrambots.meta.generics.LongPollingBot- Overrides:
onUpdateReceivedin classBaseAbilityBot- Parameters:
update- the update received by Telegram's API
-
clearWebhook
public void clearWebhook() throws org.telegram.telegrambots.meta.exceptions.TelegramApiRequestException- Specified by:
clearWebhookin interfaceorg.telegram.telegrambots.meta.generics.LongPollingBot- Throws:
org.telegram.telegrambots.meta.exceptions.TelegramApiRequestException
-