Added the framework for a console.

This commit is contained in:
Andrew Lalis 2017-06-20 15:32:26 +02:00
parent 4f97ce6e87
commit 8cc95e4d68
3 changed files with 70 additions and 1 deletions

View File

@ -63,6 +63,14 @@ public class CommandHandler {
this.bot.getMusicPlayer().quit(guild);
} else if (command.equals("playlist")){
//Do playlist actions.
//TODO perform actions!
} else if (command.equals("prefix") && args.length == 1){
//Set the prefix to the first argument.
if (args[0].length() != 1){
new DisappearingMessage(channel, "You may only set the prefix to 1 character. To do otherwise is simply foolish.", 3000);
} else {
setPrefix(args[0]);
}
}
}
}
@ -121,7 +129,7 @@ public class CommandHandler {
* Sets the prefix used to identify commands.
* @param prefix The prefix appended to the beginning of commands.
*/
public void setPrefix(String prefix){
public static void setPrefix(String prefix){
PREFIX = prefix;
}

View File

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="handiebot.view.View">
<grid id="27dc6" binding="panel1" default-binding="true" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="500" height="400"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<scrollpane id="d0969">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="42510" class="javax.swing.JTextArea" binding="outputArea">
<constraints/>
<properties>
<lineWrap value="true"/>
<selectedTextColor color="-39481"/>
<selectionColor color="-7743853"/>
<wrapStyleWord value="true"/>
</properties>
</component>
</children>
</scrollpane>
<grid id="b8806" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="f978" class="javax.swing.JTextField" binding="commandField">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties/>
</component>
</children>
</grid>
</children>
</grid>
</form>

View File

@ -0,0 +1,12 @@
package handiebot.view;
import javax.swing.*;
/**
* @author Andrew Lalis
*/
public class View {
private JPanel panel1;
private JTextArea outputArea;
private JTextField commandField;
}