Class Ability
- java.lang.Object
-
- org.telegram.abilitybots.api.objects.Ability
-
public final class Ability extends Object
An ability is a fully-fledged bot action that contains all the necessary information to process:- A response to a command
- A post-response to a command
- A reply to a sequence of actions
In-order to instantiate an ability, you can call
builder()to get theAbility.AbilityBuilder. Once you're done setting your ability, you'll callAbility.AbilityBuilder.build()to get your constructed ability.The only optional fields in an ability are
info,postAction,flagsandreplies.- Author:
- Abbas Abou Daya
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbility.AbilityBuilder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Consumer<MessageContext>action()static Ability.AbilityBuilderbuilder()booleanequals(Object o)List<Predicate<org.telegram.telegrambots.meta.api.objects.Update>>flags()inthashCode()Stringinfo()Localitylocality()Stringname()Consumer<MessageContext>postAction()Privacyprivacy()List<Reply>replies()inttokens()StringtoString()
-
-
-
Method Detail
-
builder
public static Ability.AbilityBuilder builder()
-
name
public String name()
-
info
public String info()
-
locality
public Locality locality()
-
privacy
public Privacy privacy()
-
tokens
public int tokens()
-
action
public Consumer<MessageContext> action()
-
postAction
public Consumer<MessageContext> postAction()
-
-