Merge pull request #735 from Chase22/fix-command-bot-constructors

Revert: Added deprecated constructor with the old style (e526b9db)
This commit is contained in:
Ruben Bermudez 2020-04-26 00:37:59 +01:00 committed by GitHub
commit 21472d67cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,7 +22,6 @@ import java.util.function.BiConsumer;
*/ */
public abstract class TelegramLongPollingCommandBot extends TelegramLongPollingBot implements ICommandRegistry { public abstract class TelegramLongPollingCommandBot extends TelegramLongPollingBot implements ICommandRegistry {
private final CommandRegistry commandRegistry; private final CommandRegistry commandRegistry;
private String botUsername;
/** /**
* Creates a TelegramLongPollingCommandBot using default options * Creates a TelegramLongPollingCommandBot using default options
@ -33,19 +32,6 @@ public abstract class TelegramLongPollingCommandBot extends TelegramLongPollingB
this(ApiContext.getInstance(DefaultBotOptions.class)); this(ApiContext.getInstance(DefaultBotOptions.class));
} }
/**
* Creates a TelegramLongPollingCommandBot using default options
* Use ICommandRegistry's methods on this bot to register commands
*
* @param botUsername Username of the bot
* @deprecated Overwrite {@link #getBotUsername() getBotUsername} instead
*/
@Deprecated
public TelegramLongPollingCommandBot(String botUsername){
this();
this.botUsername = botUsername;
}
/** /**
* Creates a TelegramLongPollingCommandBot with custom options and allowing commands with * Creates a TelegramLongPollingCommandBot with custom options and allowing commands with
* usernames * usernames
@ -152,9 +138,7 @@ public abstract class TelegramLongPollingCommandBot extends TelegramLongPollingB
* @return Bot username * @return Bot username
*/ */
@Override @Override
public String getBotUsername(){ public abstract String getBotUsername();
return this.botUsername;
};
/** /**
* Process all updates, that are not commands. * Process all updates, that are not commands.