Started connect command

This commit is contained in:
Norbi Peti 2016-10-25 22:21:25 +02:00
parent 73629cbd64
commit 0d4dc309a5
2 changed files with 35 additions and 1 deletions

View file

@ -0,0 +1,21 @@
package buttondevteam.discordplugin.commands;
import sx.blah.discord.handle.obj.IMessage;
public class ConnectCommand extends DiscordCommandBase {
@Override
public String getCommandName() {
return "connect";
}
@Override
public void run(IMessage message, String args) { // TODO: Throws?
try {
message.getChannel().sendMessage("Connect command WIP.");
} catch (Exception e) {
e.printStackTrace();
}
}
}

View file

@ -1,7 +1,20 @@
package buttondevteam.discordplugin.commands;
import java.util.HashMap;
import sx.blah.discord.handle.obj.IMessage;
public abstract class DiscordCommandBase {
public abstract String getCommandName();
public abstract void Run();
public abstract void run(IMessage message, String args);
private static final HashMap<String, DiscordCommandBase> commands = new HashMap<String, DiscordCommandBase>();
static {
commands.put("connect", new ConnectCommand()); // TODO: API for adding commands?
}
public static final void runCommand(IMessage message) {
}
}