Skip to content

Commit

Permalink
Release 0.3.2
Browse files Browse the repository at this point in the history
added a few admin commands NOTHING NEW FOR NORMAL USERS
  • Loading branch information
phost1111 committed Feb 17, 2017
1 parent 96edb34 commit b0a705b
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/main/java/client/ClientManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import sx.blah.discord.api.ClientBuilder;
import sx.blah.discord.api.IDiscordClient;
import sx.blah.discord.api.events.EventDispatcher;
import sx.blah.discord.handle.obj.Status;
import sx.blah.discord.util.DiscordException;

/**
Expand All @@ -14,7 +13,7 @@ public class ClientManager {
public static boolean isDeveloperMode;
public static IDiscordClient theClient;
public static EventDispatcher theDispatcher;
public static String Version = "0.3.2-SNAPSHOT";
public static String Version = "0.3.2";


public static void newClientInstance(String token, Boolean login){
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/console/ConsoleCommandManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,15 @@ public static void consoleCommandIn(String consoleCommand) throws IOException, R
ConsoleCommands.shutdownConsoleCommand();
return;
}

if(args.get(0).equals("write")){
ConsoleCommands.writeConsoleCommand(args);
return;
}

if(args.get(0).equals("help")){
ConsoleCommands.helpConsoleCommand(ClientManager.getClientInstance().getOrCreatePMChannel(ClientManager.getClientInstance().getUserByID("139354514091147264")));
return;
}
}
}
20 changes: 20 additions & 0 deletions src/main/java/console/ConsoleCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,24 @@ public static void setPlayingConsoleCommand(ArrayList<String> args) {
public static void shutdownConsoleCommand() throws DiscordException {
ClientManager.endClientInstance();
}

public static void writeConsoleCommand(ArrayList<String> args) {
if(args.size() > 2) {
String ChannelID = args.get(1);
args.remove(0);
args.remove(0);
String out = "";
int o = args.size();
while(o >= 1) {
out += args.get(args.size() - o) + " ";
o--;
}
MessageSender.sendMessage(out, ClientManager.getClientInstance().getChannelByID(ChannelID));

}
}

public static void helpConsoleCommand(IChannel channel){
MessageSender.sendMessage("```rl\nannounce <msg>\ndelmsg <msgID>\nsetplaying <text>\nshutdown\nwrite <channelID, text>```", channel);
}
}
2 changes: 1 addition & 1 deletion src/main/java/main.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class main {
public static void main(String[] args) throws IOException {

Scanner scanner = new Scanner(System.in);
ClientManager.setDeveloperMode(true); //THIS TELLS THE BOT WHETHER HE IS IN DEV MODE OR NOT
ClientManager.setDeveloperMode(false); //THIS TELLS THE BOT WHETHER HE IS IN DEV MODE OR NOT
System.out.println("Please enter your bot Token");
FileManager.createFileObject();
ClientManager.newClientInstance(scanner.next(), true);
Expand Down

0 comments on commit b0a705b

Please sign in to comment.