Browse Source

feat: Parametrage type de réponses

Martin Passard 7 years ago
parent
commit
9131e166a4

+ 54 - 43
ressources/config/default.properties

@@ -1,43 +1,54 @@
-#### UneFede DEFAULT configuration
-#### DO NOT EDIT HERE !! ####
-#### OVERRIDEN BY config.properties ####
-
-### Setting the bot ###
-
-## IRC server and channel settings ##
-#Main server address
-SERVER=irc.geeknode.net
-#Main port
-PORT=6667
-#Channels with
-CHANNELS=#Marmat,#ffdn
-
-##IRC bot admins setting ##
-#Set who will be messaged if the bot needs to: exemple: if it get's kicked from somewhere
-#To set multiple admins, use the character ',' to split them.
-Admins=Marmat
-
-## Bot settings
-#Time the bot will wait until it retry to connect when disconnected
-Timeout_before_reconnecting=360
-#Time in milliseconds beween each messages the bot can say
-Time_between_messages=200
-#Time in miliseconds the bot will wait before reconnecting to a channel it just went kicked of
-Wait_before_reconnecting_when_kicked=10000
-
-##Developpment and debug settings
-#Will the bot be explicit or stay quiet (Warning: It Speaks a LOT!)
-Debug=false;
-
-##DB cache settings
-#Time between each +reload allowed in seconds
-Minimum_time_beetween_+reload=360
-#Time between each autoreload in seconds
-CacheReloader_timeout=3600
-
-## Actions settings
-Caractere_commande=-
-
-## Allowed Actions Properties
-listeall=true
-infoall=false
+#### UneFede DEFAULT configuration
+#### DO NOT EDIT HERE !! ####
+#### OVERRIDEN BY config.properties ####
+
+### Setting the bot ###
+
+## IRC server and channel settings ##
+#Main server address
+SERVER=irc.geeknode.net
+#Main port
+PORT=6667
+#Channels with
+CHANNELS=#Marmat,#ffdn
+
+##IRC bot admins setting ##
+#Set who will be messaged if the bot needs to: exemple: if it get's kicked from somewhere
+#To set multiple admins, use the character ',' to split them.
+Admins=Marmat
+
+## Bot settings
+#Bot name
+Bot_name=UneFede2
+#Bot description
+Bot_desc=Gentille Droide de la fédération, <3 Marmat
+#Time the bot will wait until it retry to connect when disconnected
+Timeout_before_reconnecting=360
+#Time in milliseconds beween each messages the bot can say
+Time_between_messages=200
+#Time in miliseconds the bot will wait before reconnecting to a channel it just went kicked of
+Wait_before_reconnecting_when_kicked=10000
+#Allow Private messages
+Allow_private_messages=true
+#Respond using private channel(true) instead of public channel(false)
+Respond_using_private_channel=true
+
+
+
+
+##Developpment and debug settings
+#Will the bot be explicit or stay quiet (Warning: It Speaks a LOT!)
+Debug=false;
+
+##DB cache settings
+#Time between each +reload allowed in seconds
+Minimum_time_beetween_+reload=360
+#Time between each autoreload in seconds
+CacheReloader_timeout=3600
+
+## Actions settings
+Caractere_commande=-
+
+## Allowed Actions Properties
+listeall=true
+infoall=false

+ 1 - 3
src/actions/Action.java

@@ -3,14 +3,12 @@ package actions;
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.List;
 
 
-import org.jibble.pircbot.PircBot;
-
 import main.Bot;
 import main.Bot;
 
 
 public abstract class Action {
 public abstract class Action {
 
 
 	public List<String> keyWords;
 	public List<String> keyWords;
-	public PircBot bot;
+	public Bot bot;
 	public volatile static char CARACTERE_COMMANDE = '+';
 	public volatile static char CARACTERE_COMMANDE = '+';
 	
 	
 	protected Action(Bot b, List<String> keywords) {
 	protected Action(Bot b, List<String> keywords) {

+ 2 - 3
src/actions/Contact.java

@@ -27,10 +27,9 @@ public class Contact extends Action {
 			Cache c = Cache.getInstance();
 			Cache c = Cache.getInstance();
 			ISP fai = c.getISPWithName(s);
 			ISP fai = c.getISPWithName(s);
 			if(fai == null) {
 			if(fai == null) {
-				bot.sendMessage(sender, "Aucun FAI "+s);
+				bot.sendMessage(sender,channel, "Aucun FAI "+s);
 			}else {
 			}else {
-				Bot b = (Bot) bot;
-				b.sendMessage(sender, fai.contact());
+				bot.sendMessages(sender, channel, fai.contact());
 			}
 			}
 		}
 		}
 
 

+ 10 - 10
src/actions/Distance.java

@@ -33,21 +33,21 @@ public class Distance extends Action {
 			latitude = Double.parseDouble(s.substring(0, s.indexOf(' ')));
 			latitude = Double.parseDouble(s.substring(0, s.indexOf(' ')));
 			s=s.substring(s.indexOf(' ')+1); // Je me et au second paramètre
 			s=s.substring(s.indexOf(' ')+1); // Je me et au second paramètre
 			longitude = Double.parseDouble(s);
 			longitude = Double.parseDouble(s);
-			affichePlusProches(latitude, longitude, sender);
+			affichePlusProches(latitude, longitude, sender, channel);
 		}catch(Exception e) {	//Cela doit alors être une adresse!
 		}catch(Exception e) {	//Cela doit alors être une adresse!
 			try {
 			try {
-				Coordinates ca = getCoordinatesFromMessage(message, channel);
+				Coordinates ca = getCoordinatesFromMessage(message, sender, channel);
 				latitude = ca.getLatitude();
 				latitude = ca.getLatitude();
 				longitude = ca.getLongitude();
 				longitude = ca.getLongitude();
-				affichePlusProches(latitude, longitude, sender);
+				affichePlusProches(latitude, longitude, sender, channel);
 			} catch (MultiplePossibleAddressException e1) {
 			} catch (MultiplePossibleAddressException e1) {
-				bot.sendMessage(sender, "Plusieurs possibilités pour cet endroit, nous choisirons le premier:");
+				bot.sendMessage(sender, channel, "Plusieurs possibilités pour cet endroit, nous choisirons le premier:");
 				for(int i = 0; i<e1.lieux.length; ++i) {
 				for(int i = 0; i<e1.lieux.length; ++i) {
-					bot.sendMessage(sender, (i+1)+":"+e1.lieux[i].toString());
+					bot.sendMessage(sender, channel, (i+1)+":"+e1.lieux[i].toString());
 				}
 				}
 				latitude = e1.lieux[0].coordonees.getLatitude();
 				latitude = e1.lieux[0].coordonees.getLatitude();
 				longitude = e1.lieux[0].coordonees.getLongitude();
 				longitude = e1.lieux[0].coordonees.getLongitude();
-				affichePlusProches(latitude, longitude, sender);
+				affichePlusProches(latitude, longitude, sender,channel);
 			}
 			}
 		}
 		}
 				
 				
@@ -55,7 +55,7 @@ public class Distance extends Action {
 
 
 	}
 	}
 	
 	
-	private void affichePlusProches(double latitude, double longitude, String channel) {
+	private void affichePlusProches(double latitude, double longitude, String sender, String channel) {
 		ISP[] plusProches = getISPPlusProche(latitude, longitude);
 		ISP[] plusProches = getISPPlusProche(latitude, longitude);
 		for(int i=0;i<plusProches.length;++i) {
 		for(int i=0;i<plusProches.length;++i) {
 			if(plusProches[i]!=null) {
 			if(plusProches[i]!=null) {
@@ -64,17 +64,17 @@ public class Distance extends Action {
 				nf.setMaximumFractionDigits(2);
 				nf.setMaximumFractionDigits(2);
 				nf.setMinimumFractionDigits(0);
 				nf.setMinimumFractionDigits(0);
 				distance = distance / 1000.0; 	//On met en KM		
 				distance = distance / 1000.0; 	//On met en KM		
-				bot.sendMessage(channel, (i+1)+": "+plusProches[i].getBetterName()+" à "+nf.format(distance)+" Km");
+				bot.sendMessage(sender,channel, (i+1)+": "+plusProches[i].getBetterName()+" à "+nf.format(distance)+" Km");
 			}
 			}
 		}
 		}
 	}
 	}
 	
 	
-	private Coordinates getCoordinatesFromMessage(String message, String channel) throws MultiplePossibleAddressException {
+	private Coordinates getCoordinatesFromMessage(String message, String sender, String channel) throws MultiplePossibleAddressException {
 		final double MAX_DIFF = 0.1; //Differences there MUST between 2 coordinates so they are seen as differents
 		final double MAX_DIFF = 0.1; //Differences there MUST between 2 coordinates so they are seen as differents
 		AddresseToGPS a2gps = new AddresseToGPS(message.substring(message.indexOf(' ')+1));
 		AddresseToGPS a2gps = new AddresseToGPS(message.substring(message.indexOf(' ')+1));
 		Lieu[] lieux = a2gps.getAllLieu();
 		Lieu[] lieux = a2gps.getAllLieu();
 		if(lieux == null || lieux.length == 0) {
 		if(lieux == null || lieux.length == 0) {
-			bot.sendMessage(channel, "Aucun lieu ne correspond. Requete effectuée: "+a2gps.getAddressToQuerry());
+			bot.sendMessage(sender,channel, "Aucun lieu ne correspond. Requete effectuée: "+a2gps.getAddressToQuerry());
 			return null;
 			return null;
 		}else if(lieux.length == 1) {
 		}else if(lieux.length == 1) {
 			return lieux[0].coordonees;
 			return lieux[0].coordonees;

+ 7 - 7
src/actions/Help.java

@@ -21,8 +21,8 @@ public class Help extends Action {
 			boolean hasreacted = false;
 			boolean hasreacted = false;
 			String commandeSansEspaces = message.replaceAll("\\s", "").substring(1); // On enleve les espaces et le +
 			String commandeSansEspaces = message.replaceAll("\\s", "").substring(1); // On enleve les espaces et le +
 			if(commandeSansEspaces.toLowerCase().equals("help")) {
 			if(commandeSansEspaces.toLowerCase().equals("help")) {
-				bot.sendMessage(sender, help());
-				afficheListeCommandes(l, sender);
+				bot.sendMessage(sender,channel, help());
+				afficheListeCommandes(l, sender, channel);
 				hasreacted = true;
 				hasreacted = true;
 			}else {
 			}else {
 				String commande = message.substring(message.indexOf(' ')+1);
 				String commande = message.substring(message.indexOf(' ')+1);
@@ -37,7 +37,7 @@ public class Help extends Action {
 							msg+=Action.CARACTERE_COMMANDE+s+" ";
 							msg+=Action.CARACTERE_COMMANDE+s+" ";
 						}
 						}
 						msg += a.help();
 						msg += a.help();
-						bot.sendMessage(sender, msg);
+						bot.sendMessage(sender,channel, msg);
 						hasreacted = true;
 						hasreacted = true;
 					}
 					}
 				}
 				}
@@ -45,18 +45,18 @@ public class Help extends Action {
 			
 			
 			// Si il n'as pas encore réagi
 			// Si il n'as pas encore réagi
 			if(!hasreacted) {
 			if(!hasreacted) {
-				bot.sendMessage(sender, "Commande inconnue.");
-				afficheListeCommandes(l, sender);
+				bot.sendMessage(sender,channel, "Commande inconnue.");
+				afficheListeCommandes(l, sender, channel);
 			}
 			}
 
 
 	}
 	}
 	
 	
-	private void afficheListeCommandes(List<Action> l, String channel) {
+	private void afficheListeCommandes(List<Action> l, String sender, String channel) {
 		String listeCommandes="Voici la liste des commandes: ";
 		String listeCommandes="Voici la liste des commandes: ";
 		for(Action a : l) {
 		for(Action a : l) {
 			listeCommandes += CARACTERE_COMMANDE+a.keyWords.get(0)+" ";
 			listeCommandes += CARACTERE_COMMANDE+a.keyWords.get(0)+" ";
 		}
 		}
-		bot.sendMessage(channel, listeCommandes);
+		bot.sendMessage(sender,channel, listeCommandes);
 	}
 	}
 
 
 	
 	

+ 5 - 5
src/actions/ID.java

@@ -40,10 +40,10 @@ public class ID extends Action {
 		}else {
 		}else {
 			ISP fai = c.getISPWithName(idString);
 			ISP fai = c.getISPWithName(idString);
 			if(fai!=null) {
 			if(fai!=null) {
-				bot.sendMessage(sender, "Le FAI "+fai.getBetterName()+" a pour ID: "+fai.getId());
-				bot.sendMessage(sender, "L'url dans db est https://db.ffdn.org/api/v1/isp/"+fai.getId()+"/");
+				bot.sendMessage(sender,channel, "Le FAI "+fai.getBetterName()+" a pour ID: "+fai.getId());
+				bot.sendMessage(sender,channel, "L'url dans db est https://db.ffdn.org/api/v1/isp/"+fai.getId()+"/");
 			}else {
 			}else {
-				erreur(sender,sender,idString+" ne correspond a aucun FAI");
+				erreur(sender,channel,idString+" ne correspond a aucun FAI");
 			}
 			}
 			
 			
 		}
 		}
@@ -51,8 +51,8 @@ public class ID extends Action {
 
 
 	}
 	}
 	
 	
-	private void erreur(String channel, String sender, String s) {
-		bot.sendMessage(channel, sender+": "+s);
+	private void erreur(String sender,String channel, String s) {
+		bot.sendMessage(sender,channel, sender+": "+s);
 	}
 	}
 
 
 	@Override
 	@Override

+ 10 - 10
src/actions/Info.java

@@ -32,7 +32,7 @@ public class Info extends Action {
 
 
 			String s = message.substring(message.indexOf(' ')+1);
 			String s = message.substring(message.indexOf(' ')+1);
 			ISPDAO idao = ISPDAO.getInstance();
 			ISPDAO idao = ISPDAO.getInstance();
-			Bot ib = (Bot)bot;
+			Bot ib = bot;
 
 
 
 
 			if(!EntierPositifNonVide.verifie(s)) {			// Un mot après +info
 			if(!EntierPositifNonVide.verifie(s)) {			// Un mot après +info
@@ -40,16 +40,16 @@ public class Info extends Action {
 
 
 				if(s.equalsIgnoreCase("all") && INFO_ALL) {	          			  // +info all
 				if(s.equalsIgnoreCase("all") && INFO_ALL) {	          			  // +info all
 					Cache c = Cache.getInstance();
 					Cache c = Cache.getInstance();
-					ib.sendMessage(sender, c.toStringIRC());
+					ib.sendMessages(sender,channel, c.toStringIRC());
 					for(ISP i : c.getListe()) {
 					for(ISP i : c.getListe()) {
 						if(i.isFFDNMember()) {
 						if(i.isFFDNMember()) {
-							ib.sendMessage(sender, i.toStringIRC());
+							ib.sendMessages(sender,channel, i.toStringIRC());
 						}
 						}
 					}
 					}
 
 
 				}else if(s.equalsIgnoreCase("ffdn")) {				//+info ffdn
 				}else if(s.equalsIgnoreCase("ffdn")) {				//+info ffdn
 					Cache c = Cache.getInstance();
 					Cache c = Cache.getInstance();
-					ib.sendMessage(sender, c.toStringIRC());
+					ib.sendMessages(sender, channel, c.toStringIRC());
 
 
 				}else {
 				}else {
 					Cache c = Cache.getInstance();
 					Cache c = Cache.getInstance();
@@ -58,10 +58,10 @@ public class Info extends Action {
 						bot.sendMessage(sender, "Recherche d'une zone "+s);
 						bot.sendMessage(sender, "Recherche d'une zone "+s);
 						ISP j = c.getISPWithGeoZone(s);
 						ISP j = c.getISPWithGeoZone(s);
 						if(j == null)
 						if(j == null)
-							bot.sendMessage(sender, "Le FAI "+s+" est Inconnu, désolé. Et aucun FAI n'opère sur une sone dénomée "+s+" ...");
+							bot.sendMessage(sender, channel, "Le FAI "+s+" est Inconnu, désolé. Et aucun FAI n'opère sur une sone dénomée "+s+" ...");
 						else {
 						else {
-							bot.sendMessage(sender, "Un FAI opère sur une zone correspondante : ");
-							ib.sendMessage(sender, j.toStringIRC());
+							bot.sendMessage(sender, channel, "Un FAI opère sur une zone correspondante : ");
+							ib.sendMessages(sender, channel, j.toStringIRC());
 							List<CoveredAreas> cas = j.getCoveredAreas(s);
 							List<CoveredAreas> cas = j.getCoveredAreas(s);
 							String technos = "Avec pour techno:";
 							String technos = "Avec pour techno:";
 							for(CoveredAreas ca: cas) {
 							for(CoveredAreas ca: cas) {
@@ -69,10 +69,10 @@ public class Info extends Action {
 								technos+=ca.getTechnos()+" ";
 								technos+=ca.getTechnos()+" ";
 								}
 								}
 							}
 							}
-							bot.sendMessage(sender, technos);
+							bot.sendMessage(sender, channel, technos);
 						}
 						}
 					}else {
 					}else {
-						ib.sendMessage(sender, i.toStringIRC());
+						ib.sendMessages(sender,channel, i.toStringIRC());
 					}
 					}
 				}
 				}
 
 
@@ -81,7 +81,7 @@ public class Info extends Action {
 				int  id = Integer.parseInt(message.substring(message.indexOf(' ')+1));
 				int  id = Integer.parseInt(message.substring(message.indexOf(' ')+1));
 				List<String> strings = idao.getISP(id).toStringIRC();
 				List<String> strings = idao.getISP(id).toStringIRC();
 				for(String response : strings) {
 				for(String response : strings) {
-					bot.sendMessage(sender,response);
+					bot.sendMessage(sender, channel, response);
 				}
 				}
 			}
 			}
 		}
 		}

+ 1 - 2
src/actions/Liste.java

@@ -73,8 +73,7 @@ public class Liste extends Action {
 			}
 			}
 		}
 		}
 		messages.add(s);
 		messages.add(s);
-		Bot b2 = (Bot) bot;
-		b2.sendMessage(sender, messages);
+		bot.sendMessages(sender,channel, messages);
 	}
 	}
 
 
 	@Override
 	@Override

+ 4 - 4
src/actions/Reload.java

@@ -21,15 +21,15 @@ public class Reload extends Action {
 		Date now = new Date();
 		Date now = new Date();
 		Date lastCU = Cache.getInstance().getLastCacheUpdate();
 		Date lastCU = Cache.getInstance().getLastCacheUpdate();
 		if(lastCU.getTime() < now.getTime()-Cache.getTIME_BETWEEN_RELOADS() ) {		// Si la dernière MAJ date de + de 5 minutes
 		if(lastCU.getTime() < now.getTime()-Cache.getTIME_BETWEEN_RELOADS() ) {		// Si la dernière MAJ date de + de 5 minutes
-			bot.sendMessage(sender, "Je lance le reload!");
+			bot.sendMessage(sender,channel, "Je lance le reload!");
 			if(reload()) {
 			if(reload()) {
-				bot.sendMessage(sender, sender+": Le reload s'est bien passé.");
+				bot.sendMessage(sender, channel, sender+": Le reload s'est bien passé.");
 			}else {
 			}else {
-				bot.sendMessage(sender, sender+": Erreur au moment du reload.");
+				bot.sendMessage(sender, channel, sender+": Erreur au moment du reload.");
 			}
 			}
 		}else {
 		}else {
 			Date nextAllowed = new Date(lastCU.getTime()+Cache.getTIME_BETWEEN_RELOADS());
 			Date nextAllowed = new Date(lastCU.getTime()+Cache.getTIME_BETWEEN_RELOADS());
-			bot.sendMessage(sender, "Trop de reload, attendez un peu. Le dernier à eu lieu le "+lastCU.toString()+" Prochain autorisé le "+nextAllowed);
+			bot.sendMessage(sender, channel, "Trop de reload, attendez un peu. Le dernier à eu lieu le "+lastCU.toString()+" Prochain autorisé le "+nextAllowed);
 		}
 		}
 		
 		
 	}
 	}

+ 1 - 1
src/actions/Source.java

@@ -18,7 +18,7 @@ public class Source extends Action {
 
 
 	@Override
 	@Override
 	public void react(String channel, String sender, String login, String hostname, String message) {
 	public void react(String channel, String sender, String login, String hostname, String message) {
-		bot.sendMessage(sender, sender+": mes sources sont disponibles ici: https://code.ffdn.org/marmat8951/bot-irc2");
+		bot.sendMessage(sender, channel, sender+": mes sources sont disponibles ici: https://code.ffdn.org/marmat8951/bot-irc2");
 	}
 	}
 
 
 	@Override
 	@Override

+ 53 - 5
src/main/Bot.java

@@ -11,8 +11,8 @@ 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;
+	private boolean responseOnPrivateChannel = true;
+	private boolean responseOnPrivateMessages = true;
 	
 	
 
 
 	public Bot() {
 	public Bot() {
@@ -30,6 +30,8 @@ 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) {
 		if(responseOnPrivateMessages) {
 		if(responseOnPrivateMessages) {
 			onMessage(sender, sender, login, hostname, message);
 			onMessage(sender, sender, login, hostname, message);
+		}else {
+			sendMessage(sender,"Eh non, Je suis configurée pour ne pas répondre aux MP. Désolé!");
 		}
 		}
 	}
 	}
 	
 	
@@ -42,8 +44,8 @@ public class Bot extends PircBot {
 			}
 			}
 		}
 		}
 		//easter Egg
 		//easter Egg
-		String ea="Ehlo UneFede";
-		if (message.contains(ea)) {
+		String ea="Ehlo "+this.getNick();
+		if (message.toLowerCase().contains(ea.toLowerCase())) {
 			sendMessage(channel, "Ehlo "+sender+"!!");
 			sendMessage(channel, "Ehlo "+sender+"!!");
 		}
 		}
 
 
@@ -67,12 +69,13 @@ public class Bot extends PircBot {
 	 * @param channel Channel IRC dans lequel envoyer les messages
 	 * @param channel Channel IRC dans lequel envoyer les messages
 	 * @param lines liste de chaaines de caractères à envoyer.
 	 * @param lines liste de chaaines de caractères à envoyer.
 	 */
 	 */
-	public void sendMessage(String channel, List<String> lines) {
+	private void sendMessage(String channel, List<String> lines) {
 		for(String s : lines) {
 		for(String s : lines) {
 			sendMessage(channel,s);
 			sendMessage(channel,s);
 		}
 		}
 	}
 	}
 	
 	
+	
 	/**
 	/**
 	 * 
 	 * 
 	 */
 	 */
@@ -126,5 +129,50 @@ public class Bot extends PircBot {
 		this.admins = admins;
 		this.admins = admins;
 	}
 	}
 
 
+	/**
+	 * @return the responseOnPrivateChannel
+	 */
+	public boolean isResponseOnPrivateChannel() {
+		return responseOnPrivateChannel;
+	}
+
+	/**
+	 * @param responseOnPrivateChannel the responseOnPrivateChannel to set
+	 */
+	public void setResponseOnPrivateChannel(boolean responseOnPrivateChannel) {
+		this.responseOnPrivateChannel = responseOnPrivateChannel;
+	}
+
+	/**
+	 * @return the responseOnPrivateMessages
+	 */
+	public boolean isResponseOnPrivateMessages() {
+		return responseOnPrivateMessages;
+	}
+
+	/**
+	 * @param responseOnPrivateMessages the responseOnPrivateMessages to set
+	 */
+	public void setResponseOnPrivateMessages(boolean responseOnPrivateMessages) {
+		this.responseOnPrivateMessages = responseOnPrivateMessages;
+	}
+
+	public void sendMessage(String sender,String channel,String message) {
+		if(this.responseOnPrivateChannel) {
+			this.sendMessage(sender, message);
+		}else {
+			this.sendMessage(channel, message);
+		}
+	}
+	
+	public void sendMessages(String sender, String channel,List<String> messages) {
+		if(this.responseOnPrivateChannel) {
+			this.sendMessage(sender, messages);
+		}else {
+			this.sendMessage(channel, messages);
+		}
+	}
+	
+	
 
 
 }
 }

+ 4 - 0
src/main/PropertiesSetter.java

@@ -60,6 +60,10 @@ public class PropertiesSetter {
 		
 		
 		Bot.setTIME_BETWEEN_MESSAGES(Long.parseLong(prop.getProperty("Time_between_messages")));
 		Bot.setTIME_BETWEEN_MESSAGES(Long.parseLong(prop.getProperty("Time_between_messages")));
 		b.setAdmins(getMultipleValues(prop, "Admins"));
 		b.setAdmins(getMultipleValues(prop, "Admins"));
+		b.setResponseOnPrivateChannel(Boolean.parseBoolean(prop.getProperty("Respond_using_private_channel")));
+		b.setResponseOnPrivateMessages(Boolean.parseBoolean(prop.getProperty("Allow_private_messages")));
+		
+		
 		
 		
 		RejoinThread.setDEFAULT_WAIT_BEFORE_RECONNECT(Long.parseLong(prop.getProperty("Wait_before_reconnecting_when_kicked")));
 		RejoinThread.setDEFAULT_WAIT_BEFORE_RECONNECT(Long.parseLong(prop.getProperty("Wait_before_reconnecting_when_kicked")));