Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No argument command aliases #43

Closed
Draycia opened this issue Jan 16, 2019 · 1 comment
Closed

No argument command aliases #43

Draycia opened this issue Jan 16, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@Draycia
Copy link

Draycia commented Jan 16, 2019

Describe the bug
When supplying an alias for a command, the alias is registered but the base command does not work. The server reports the alias (/balance in this instance) as a valid command, but when trying to run it I get the error Unknown Command

I should note that supplying arguments to the alias'd command does work. /balance Player works whereas /balance does not.

My code
This code reproduces the behavior:

    override val command = "bal"
    override val permission = CommandPermission.fromString("commands.balance")!!;
    override val aliases = arrayOf("balance");

    private fun run(sender: CommandSender, args: Array<Any>) {

    }

    private fun other(sender: CommandSender, args: Array<Any>) {

    }

    override fun registerCommand() {
        val args = linkedMapOf<String, Argument>();
        CommandAPI.getInstance().register(command, permission, aliases, args, ::run);

        args["Player"] = StringArgument();
        CommandAPI.getInstance().register(command, permission, aliases, args, ::other);
    }

Expected behavior
The base command with no args is successfully run either through the alias or the non alias.

Screenshots
https://i.imgur.com/5CTg18o.png
The first line is me running /bal and the second is me running /balance

@JorelAli JorelAli added the bug Something isn't working label Apr 6, 2019
JorelAli added a commit that referenced this issue Apr 6, 2019
JorelAli added a commit that referenced this issue Jul 17, 2019
JorelAli added a commit that referenced this issue Jul 18, 2019
@JorelAli
Copy link
Owner

Fixed in 2.1 release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants