some shit to do with the command manager, again
Signed-off-by: deepCurse <leverplays@gmail.com>
This commit is contained in:
parent
22837cf438
commit
cda31cfaa0
9 changed files with 237 additions and 108 deletions
|
@ -0,0 +1,58 @@
|
|||
package pkg.deepCurse.nopalmo.command.commands.general;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import pkg.deepCurse.nopalmo.command.CommandInterface.GuildCommandInterface;
|
||||
import pkg.deepCurse.nopalmo.database.DatabaseTools.Tools.Global;
|
||||
import pkg.deepCurse.nopalmo.database.DatabaseTools.Tools.Guild;
|
||||
import pkg.deepCurse.nopalmo.manager.Argument;
|
||||
import pkg.deepCurse.nopalmo.manager.GuildCommandBlob;
|
||||
|
||||
public class Prefix implements GuildCommandInterface {
|
||||
|
||||
@Override
|
||||
public String[] getCommandCalls() {
|
||||
return new String[] { "prefix", };
|
||||
}
|
||||
|
||||
@Override
|
||||
public HelpPage getHelpPage() {
|
||||
return HelpPage.General;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void runGuildCommand(GuildCommandBlob blob, HashMap<String, Argument> argumentList) throws Exception {
|
||||
|
||||
if (argumentList.get("prefix") != null) {
|
||||
// System.out.println(argumentList.get("prefix").getWildCardString());
|
||||
Guild.Prefix.setPrefix(
|
||||
blob.getEvent().getGuild().getIdLong(), argumentList.get("prefix").getWildCardString());
|
||||
blob.getEvent().getChannel().sendMessage("Set prefix to " + argumentList.get("prefix").getWildCardString()).queue();
|
||||
} else {
|
||||
Guild.Prefix.setPrefix(
|
||||
blob.getEvent().getGuild().getIdLong(), Global.prefix);
|
||||
blob.getEvent().getChannel().sendMessage("Reset prefix to default").queue();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<String, Argument> getArguments() {
|
||||
HashMap<String, Argument> args = new HashMap<String, Argument>();
|
||||
|
||||
args.put("prefix", new Argument("prefix").setPosition(0).setIsWildcard(true));
|
||||
|
||||
return args;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUsage() {
|
||||
return Global.prefix + getCommandName() + " <prefix>";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHelp() {
|
||||
return "Sets a prefix for your guild";
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue