Browse Source

Feat: répond aux MP

Martin Passard 7 years ago
parent
commit
b9752a2929
1 changed files with 6 additions and 1 deletions
  1. 6 1
      src/main/Bot.java

+ 6 - 1
src/main/Bot.java

@@ -11,6 +11,9 @@ public class Bot extends PircBot {
 	private volatile static long TIME_BETWEEN_MESSAGES = 200;
 	private volatile static long TIME_BETWEEN_MESSAGES = 200;
 	private List<Action> actions = Action.getAllActions(this);
 	private List<Action> actions = Action.getAllActions(this);
 	private String[] admins;
 	private String[] admins;
+	public boolean responseOnPrivateChannel = true;
+	public boolean responseOnPrivateMessages = true;
+	
 
 
 	public Bot() {
 	public Bot() {
 		this.setAutoNickChange(true);
 		this.setAutoNickChange(true);
@@ -25,7 +28,9 @@ public class Bot extends PircBot {
 	}
 	}
 	
 	
 	public void onPrivateMessage(String sender, String login, String hostname, String message) {
 	public void onPrivateMessage(String sender, String login, String hostname, String message) {
-		this.sendMessage(sender, "Bonjour a toi "+sender+". Pas la peine de me demander mon 06, je ne répond pas aux messages privés. Sauf certains spéciaux.");
+		if(responseOnPrivateMessages) {
+			onMessage(sender, sender, login, hostname, message);
+		}
 	}
 	}
 	
 	
 	public void onMessage(String channel, String sender,
 	public void onMessage(String channel, String sender,