forked from chipmunkmc/chipmunkbot
echo command
This commit is contained in:
parent
5deddd71ab
commit
7016057399
1 changed files with 6 additions and 7 deletions
|
@ -14,19 +14,18 @@ public class RunCommand extends Command {
|
|||
super();
|
||||
|
||||
this.node(
|
||||
literal("run")
|
||||
literal("echo")
|
||||
.then(
|
||||
argument("command", greedyString())
|
||||
.executes(this::run)
|
||||
argument("text", greedyString())
|
||||
.executes(this::echo)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public int run (CommandContext<CommandSource> context) {
|
||||
public int echo (CommandContext<CommandSource> context) {
|
||||
final CommandSource source = context.getSource();
|
||||
final ChipmunkBot client = source.client();
|
||||
|
||||
client.core().run(getString(context, "command"));
|
||||
final String text = getString(context, "command");
|
||||
source.sendOutput(Component.text(text));
|
||||
|
||||
return 1;
|
||||
}
|
Loading…
Reference in a new issue