Skip to content

Commit b0d7a6a

Browse files
committed
Command tests are done.
1 parent 34c7f1d commit b0d7a6a

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
id 'com.github.johnrengelman.shadow' version '4.0.4'
55
}
66
group 'io.github.thedoctorone.MinecraftConnectsDiscord'
7-
version '0.1'
7+
version '0.3'
88

99
sourceCompatibility = 1.8
1010

src/main/java/io/github/thedoctorone/CommandReload.java

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ public class CommandReload implements CommandExecutor {
1414
private Main main;
1515
private String fast = "fast";
1616
private String full = "full";
17-
private String helpMessage = "Minecraft Connects Discord by Mahmut H. Kocas\n" +
17+
private String helpMessage = "\n*****************************************************************\n" +
18+
"Minecraft Connects Discord by Mahmut H. Kocas\n" +
1819
"/discord : Commands\n" +
1920
"/discord fast : Changes everything according to config file except Discord Bot Token\n" +
2021
"/discord full : Changes everything according to config file\n" +
21-
"";
22+
"*****************************************************************";
2223

2324
CommandReload (Main main, DiscordCommunication dc) {
2425
this.dc = dc;
@@ -28,22 +29,25 @@ public class CommandReload implements CommandExecutor {
2829
@Override
2930
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
3031
/*
31-
* Args = "" -> Help
32+
* Args[0] = null -> Help
3233
* Args[0] -> Fast Reload - Only Reloads the messages
3334
* Args[0] -> Full Reload - Reloads whole bot
3435
* */
3536
try {
36-
if(args[0].equals(fast)) { //Fast
37-
fastReload(sender);
37+
if(args.length == 0) { //Empty - Sends help
38+
sendHelp(sender);
3839
return true;
3940
} else if(args[0].equals(full)) { //Full
41+
sender.sendMessage("Full Reload Starting...");
4042
fullReload(sender);
43+
sender.sendMessage("Full Reload Successful!");
4144
return true;
42-
} else if(args[0] == "") { //Empty - Sends help
43-
sendHelp(sender);
45+
} else if(args[0].equals(fast)) { //Fast
46+
sender.sendMessage("Fast Reload Starting...");
47+
fastReload(sender);
48+
sender.sendMessage("Fast Reload Successful!");
4449
return true;
4550
}
46-
4751
} catch (IOException | LoginException e) {
4852
main.getLogger().warning("ERROR - CONFIG READ - IO EXCEPTION");
4953
sender.sendMessage("ERROR - CONFIG READ - IO EXCEPTION");

src/main/resources/plugin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
main: io.github.thedoctorone.App
1+
main: io.github.thedoctorone.Main
22
name: DiscordConnectsMinecraft
33
version: 0.1
44
commands:

0 commit comments

Comments
 (0)