[Solved] Retrieving the output from dispatchCommand

Discussion in 'Plugin Development' started by fletch_to_99, Feb 6, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    fletch_to_99

    Hey,

    People have requested on my IRC plugin that they wanted to be able to send a command from IRC. I have managed to set this up however I have no way of receiving the output from the command to tell if it executed successfully or such. This, in theory, makes certain commands useless such as /list.

    It is sending the command as the console to the only way to check the output for the command is by looking at the console. This make IRC commands useless to anyone that doesn't have access to the console.

    Here is how I execute the command:
    Code:
                    CommandSender console = Bukkit.getConsoleSender();
                    plugin.getServer().dispatchCommand(console,
                            message.substring(message.indexOf(Variables.commandPrefix) + 1));
    If you have an idea on how this can be done please reply here or create a pull requests on my github with the code: https://github.com/Monstercraft/MonsterIRC/

    Thanks,
    ~Fletch
     
  2. Offline

    nisovin

    I believe you can create your own class that implements CommandSender. You could then use that to dispatch a command, and you'd receive output through the sendMessage() method.
     
  3. Offline

    fletch_to_99

    Good idea, thanks.
     
Thread Status:
Not open for further replies.

Share This Page