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
public abstract class AbilityBot extends BaseAbilityBot implements org.telegram.telegrambots.meta.generics.LongPollingBot
The default AbilityBot class implementsLongPollingBot. It delegates all updates to aTelegramLongPollingBotinstance.- Author:
- Abbas Abou Daya
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbilityBot(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearWebhook()voidonUpdateReceived(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, admins, blacklist, checkGlobalFlags, creatorId, getBotToken, getBotUsername, replies, 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, getBaseUrl, getOptions, sendApiMethod, sendApiMethodAsync
-
Methods inherited from class org.telegram.telegrambots.meta.bots.AbsSender
execute, executeAsync, getMe, getMeAsync, getWebhookInfo, getWebhookInfoAsync
-
-
-
-
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: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
-
-