Skip to content
This repository has been archived by the owner on Dec 5, 2020. It is now read-only.

Commit

Permalink
Add support for custom messages
Browse files Browse the repository at this point in the history
  • Loading branch information
132ikl committed Jun 2, 2020
1 parent 35ee773 commit 00f70ce
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ public void registerCommands() throws FileNotFoundException, NoSuchMethodExcepti
{
put("online", CommandOnline.class);
put("help", CommandHelp.class);
put("message", CommandMessage.class);
put("minecraft", MinecraftCommand.class);
}
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package club.moddedminecraft.polychat.server.command;

import club.moddedminecraft.polychat.server.Main;

import java.util.Map;

public class CommandMessage extends Command {
private final String message;

public CommandMessage(String name, Map<String, Object> args) {
super(name, args);
this.message = (String) args.get("message");
}

@Override
public String getDescription() {
return "Show predefined message";
}

public String run(String[] args, String channel) {
return this.message;
}
}

0 comments on commit 00f70ce

Please sign in to comment.