From 2963971fa3ce05778d39c6bd4ee863065c871cc1 Mon Sep 17 00:00:00 2001 From: nubdub Date: Fri, 10 Dec 2021 20:39:15 -0500 Subject: [PATCH] Add javadoc and comments --- .../abilitybots/api/bot/ExtensionTest.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/telegrambots-abilities/src/test/java/org/telegram/abilitybots/api/bot/ExtensionTest.java b/telegrambots-abilities/src/test/java/org/telegram/abilitybots/api/bot/ExtensionTest.java index 1f0e6735..293cdbe6 100644 --- a/telegrambots-abilities/src/test/java/org/telegram/abilitybots/api/bot/ExtensionTest.java +++ b/telegrambots-abilities/src/test/java/org/telegram/abilitybots/api/bot/ExtensionTest.java @@ -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();