Class AbilityBot
Object
BaseAbilityBot
AbilityBot
- All Implemented Interfaces:
AbilityExtension,LongPollingUpdateConsumer,LongPollingSingleThreadUpdateConsumer
The default AbilityBot class implements
LongPollingSingleThreadUpdateConsumer.
It delegates all updates to a TelegramClient instance.- Author:
- Abbas Abou Daya
-
Field Summary
Fields inherited from class BaseAbilityBot
ADMINS, BLACKLIST, db, DEFAULT, silent, STATS, telegramClient, USER_ID, USERSFields inherited from interface LongPollingSingleThreadUpdateConsumer
updatesProcessorExecutor -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbilityBot(TelegramClient telegramClient, String botUsername) protectedAbilityBot(TelegramClient telegramClient, String botUsername, DBContext db) protectedAbilityBot(TelegramClient telegramClient, String botUsername, DBContext db, AbilityToggle toggle) protectedAbilityBot(TelegramClient telegramClient, String botUsername, AbilityToggle toggle) -
Method Summary
Modifier and TypeMethodDescriptionvoidconsume(Update update) This method contains the stream of actions that are applied on any update.Methods inherited from class BaseAbilityBot
addExtension, addExtensions, addExtensions, admins, allowContinuousText, blacklist, checkGlobalFlags, creatorId, getCommandPrefix, getCommandRegexSplit, getPrivacy, isAdmin, isCreator, isGroupAdmin, isGroupAdmin, onRegister, userIds, usersMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface LongPollingSingleThreadUpdateConsumer
consume
-
Constructor Details
-
AbilityBot
protected AbilityBot(TelegramClient telegramClient, String botUsername, DBContext db, AbilityToggle toggle) -
AbilityBot
-
AbilityBot
-
AbilityBot
-
-
Method Details
-
consume
public void consume(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:
consumein interfaceLongPollingSingleThreadUpdateConsumer- Overrides:
consumein classBaseAbilityBot- Parameters:
update- the update received by Telegram's API
-