Fixed bot username
Let the programmer of the bot decide where the username should come from
This commit is contained in:
parent
e616ebbddb
commit
01a7e7dc21
@ -58,7 +58,7 @@ public abstract class TelegramLongPollingCommandBot extends TelegramLongPollingB
|
||||
public TelegramLongPollingCommandBot(DefaultBotOptions options, boolean allowCommandsWithUsername, String botUsername) {
|
||||
super(options);
|
||||
this.botUsername = botUsername;
|
||||
this.commandRegistry = new CommandRegistry(allowCommandsWithUsername, botUsername);
|
||||
this.commandRegistry = new CommandRegistry(allowCommandsWithUsername, this.getBotUsername());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -143,9 +143,7 @@ public abstract class TelegramLongPollingCommandBot extends TelegramLongPollingB
|
||||
* @return Bot username
|
||||
*/
|
||||
@Override
|
||||
public final String getBotUsername() {
|
||||
return botUsername;
|
||||
}
|
||||
public abstract String getBotUsername();
|
||||
|
||||
/**
|
||||
* Process all updates, that are not commands.
|
||||
|
Loading…
x
Reference in New Issue
Block a user