constructor correction

This commit is contained in:
xDrake 2017-06-10 09:08:23 +03:00
parent 5e5bbe4f77
commit 799949e80f

View File

@ -44,10 +44,7 @@ public abstract class TelegramLongPollingCommandBot extends TelegramLongPollingB
* @param options Bot options * @param options Bot options
* @param allowCommandsWithUsername true to allow commands with parameters (default), * @param allowCommandsWithUsername true to allow commands with parameters (default),
* false otherwise * false otherwise
*
* @deprecated When calling this constructor, method getUsername() is not yet initialized in a subclass
*/ */
@Deprecated
public TelegramLongPollingCommandBot(DefaultBotOptions options, boolean allowCommandsWithUsername) { public TelegramLongPollingCommandBot(DefaultBotOptions options, boolean allowCommandsWithUsername) {
super(options); super(options);
this.commandRegistry = new CommandRegistry(allowCommandsWithUsername, getBotUsername()); this.commandRegistry = new CommandRegistry(allowCommandsWithUsername, getBotUsername());
@ -57,11 +54,11 @@ public abstract class TelegramLongPollingCommandBot extends TelegramLongPollingB
* Creates a TelegramLongPollingCommandBot * Creates a TelegramLongPollingCommandBot
* Use ICommandRegistry's methods on this bot to register commands * Use ICommandRegistry's methods on this bot to register commands
* @param options Bot options * @param options Bot options
* @param botUsername bot username of this bot
* @param allowCommandsWithUsername true to allow commands with parameters (default), * @param allowCommandsWithUsername true to allow commands with parameters (default),
* false otherwise * false otherwise
* @param botUsername bot username of this bot
*/ */
public TelegramLongPollingCommandBot(DefaultBotOptions options, String botUsername, boolean allowCommandsWithUsername) { public TelegramLongPollingCommandBot(DefaultBotOptions options, boolean allowCommandsWithUsername, String botUsername) {
super(options); super(options);
this.commandRegistry = new CommandRegistry(allowCommandsWithUsername, botUsername); this.commandRegistry = new CommandRegistry(allowCommandsWithUsername, botUsername);
} }