Deprecate old constructor
This commit is contained in:
parent
5ea6fc9f09
commit
cdef29f1ba
@ -29,7 +29,10 @@ public final class CommandRegistry implements ICommandRegistry {
|
|||||||
*
|
*
|
||||||
* @param allowCommandsWithUsername True to allow commands with username, false otherwise
|
* @param allowCommandsWithUsername True to allow commands with username, false otherwise
|
||||||
* @param botUsername Bot username
|
* @param botUsername Bot username
|
||||||
|
* @throws java.lang.NullPointerException if {@code botUsername} is {@code null}
|
||||||
|
* @deprecated Use {@link #CommandRegistry(boolean, java.util.function.Supplier)} instead
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public CommandRegistry(boolean allowCommandsWithUsername, String botUsername) {
|
public CommandRegistry(boolean allowCommandsWithUsername, String botUsername) {
|
||||||
Objects.requireNonNull(botUsername, "Bot username must not be null");
|
Objects.requireNonNull(botUsername, "Bot username must not be null");
|
||||||
this.allowCommandsWithUsername = allowCommandsWithUsername;
|
this.allowCommandsWithUsername = allowCommandsWithUsername;
|
||||||
@ -134,6 +137,8 @@ public final class CommandRegistry implements ICommandRegistry {
|
|||||||
* the command
|
* the command
|
||||||
* @param command Command to simplify
|
* @param command Command to simplify
|
||||||
* @return Simplified command
|
* @return Simplified command
|
||||||
|
* @throws java.lang.NullPointerException if {@code allowCommandsWithUsername} is {@code true}
|
||||||
|
* and {@code botUsernameSupplier} returns {@code null}
|
||||||
*/
|
*/
|
||||||
private String removeUsernameFromCommandIfNeeded(String command) {
|
private String removeUsernameFromCommandIfNeeded(String command) {
|
||||||
if (allowCommandsWithUsername) {
|
if (allowCommandsWithUsername) {
|
||||||
|
Loading…
Reference in New Issue
Block a user