Browse Source

fix: bug du +liste && fix: initialisation du debug sur le bot

Martin Passard 7 years ago
parent
commit
f71334ebe7
2 changed files with 7 additions and 11 deletions
  1. 6 1
      src/main/Bot.java
  2. 1 10
      src/main/Main.java

+ 6 - 1
src/main/Bot.java

@@ -18,6 +18,11 @@ public class Bot extends PircBot {
 
 	public Bot() {
 		this.setName("UneFede2");
+		if(Main.isDebug()) {
+			this.setVerbose(true);
+		}else {
+			this.setVerbose(false);
+		}
 		idao = ISPDAO.getInstance();
 	}
 
@@ -37,7 +42,7 @@ public class Bot extends PircBot {
 		}
 
 
-		if (message.length()> 6 && message.substring(0, 6).equals("+liste")) {
+		if (message.length()>= 6 && message.substring(0, 6).equals("+liste")) {
 			list(channel, sender, login, hostname, message);
 		}
 

+ 1 - 10
src/main/Main.java

@@ -17,13 +17,9 @@ public class Main {
 		try {
 			setDebug(args[0].equals("-debug"));
 
-
-
 			// Now start our bot up.
 			Bot bot = new Bot();
 
-
-
 			// Connect to the IRC server.
 			bot.connect(SERVER,PORT);
 
@@ -39,12 +35,7 @@ public class Main {
 			
 			
 			
-			if(isDebug()) {
-				// Enable debugging output.
-				bot.setVerbose(true);
-			}else {
-				bot.setVerbose(false);
-			}
+			
 			
 			System.out.println("Debug? "+DEBUG);