Started connect command
This commit is contained in:
parent
73629cbd64
commit
0d4dc309a5
2 changed files with 35 additions and 1 deletions
|
@ -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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,7 +1,20 @@
|
||||||
package buttondevteam.discordplugin.commands;
|
package buttondevteam.discordplugin.commands;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import sx.blah.discord.handle.obj.IMessage;
|
||||||
|
|
||||||
public abstract class DiscordCommandBase {
|
public abstract class DiscordCommandBase {
|
||||||
public abstract String getCommandName();
|
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) {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue