Open ganduras381 opened 6 years ago
Code written in Eclipse:
import org.telegram.abilitybots.api.bot.AbilityBot; import org.telegram.abilitybots.api.objects.Ability; import org.telegram.abilitybots.api.objects.Ability.AbilityBuilder; import org.telegram.telegrambots.bots.DefaultBotOptions; import org.telegram.abilitybots.api.objects.Locality; import org.telegram.abilitybots.api.objects.Privacy; public class Bot extends AbilityBot { protected Bot(String botToken, String botUsername) { super(botToken, botUsername); } public int creatorId() { return 555; } public Ability hello() { return Ability.builder() .name("test") .info("hello bot") .locality(ALL) // ALL cannot be resolved to a variable .privacy(ADMIN) // ADMIN cannot be resolved to a variable .action(ctx -> silent.send("hello!", ctx.chatId())) .build(); } }
Why?
ALL and ADMIN are enum objects from Locality and Privacy. Import them!
something like
import static org.telegram.abilitybots.api.objects.Locality.*; import static org.telegram.abilitybots.api.objects.Privacy.*;
Code written in Eclipse:
Why?