Fixed bot username

Let the programmer of the bot decide where the username should come from
This commit is contained in:
j.r@wiuwiu.de 2019-06-27 20:58:16 +02:00
parent e616ebbddb
commit 01a7e7dc21
1 changed files with 2 additions and 4 deletions

View File

@ -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.