Add javadoc and comments

This commit is contained in:
nubdub 2021-12-10 20:39:15 -05:00
parent 7dd0711cdb
commit 2963971fa3

View File

@ -41,7 +41,11 @@ class ExtensionTest {
}
public static class ExtensionUsingBot extends AbilityBot {
/**
* Constructor for ExtensionUsingBot
*/
ExtensionUsingBot() {
// https://github.com/rubenlagus/TelegramBots/issues/834
super("", "", offlineInstance("testing"));
addExtension(new AbilityBotExtension("addedInConstructor", this));
}
@ -51,11 +55,21 @@ class ExtensionTest {
return 0;
}
/**
* Method for returning AbiltyExtension
* @return AbilityBotExtension instance
*/
public AbilityBotExtension methodReturningExtensionSubClass() {
// https://github.com/rubenlagus/TelegramBots/issues/834
return new AbilityBotExtension("returningSubClass", this);
}
/**
* Method for returning AbilityExtension
* @return AbiltyBotExtension instance
*/
public AbilityExtension methodReturningExtensionSuperClass() {
// https://github.com/rubenlagus/TelegramBots/issues/834
return new AbilityBotExtension("returningSuperClass", this);
}
@ -75,8 +89,15 @@ class ExtensionTest {
private String name;
private AbilityBot extensionUser;
/**
* https://github.com/rubenlagus/TelegramBots/issues/721
* Constructor for AbilityBotExtension
* @param name Name of the ability extension
* @param extensionUser The AbilityBot that uses this AbilityExtension
*/
AbilityBotExtension(String name, AbilityBot extensionUser) {
this.name = name;
// https://github.com/rubenlagus/TelegramBots/issues/834
this.extensionUser = extensionUser;
}
@ -87,6 +108,7 @@ class ExtensionTest {
.locality(ALL)
.privacy(PUBLIC)
.action(ctx -> {
// https://github.com/rubenlagus/TelegramBots/issues/834
extensionUser.silent().send("This is a test message.", ctx.chatId());
})
.build();