Revert: Added deprecated constructor with the old style (e526b9db)

This commit causes a bug if using the normal constructors without
overriding getBotUsername and since it's no longer abstract it doesn't force you to implement the method,
even though it is needed in any case aside from the deprecated one
This commit is contained in:
Lukas Prediger 2020-03-05 17:01:06 +01:00
parent 00f68950aa
commit cc0e0c9771
1 changed files with 1 additions and 17 deletions

View File

@ -22,7 +22,6 @@ import java.util.function.BiConsumer;
*/
public abstract class TelegramLongPollingCommandBot extends TelegramLongPollingBot implements ICommandRegistry {
private final CommandRegistry commandRegistry;
private String botUsername;
/**
* Creates a TelegramLongPollingCommandBot using default options
@ -33,19 +32,6 @@ public abstract class TelegramLongPollingCommandBot extends TelegramLongPollingB
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
* usernames
@ -152,9 +138,7 @@ public abstract class TelegramLongPollingCommandBot extends TelegramLongPollingB
* @return Bot username
*/
@Override
public String getBotUsername(){
return this.botUsername;
};
public abstract String getBotUsername();
/**
* Process all updates, that are not commands.