From b1ac7caadd5b1d49411fd12caf4bf28e95a05048 Mon Sep 17 00:00:00 2001 From: Nicolas VINOT Date: Mon, 5 Sep 2011 10:42:07 +0200 Subject: [PATCH] % is for comment, otherwise it's a topic entry --- src/main/java/fr/imirhil/april/hebdobot/Bot.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/fr/imirhil/april/hebdobot/Bot.java b/src/main/java/fr/imirhil/april/hebdobot/Bot.java index 91324ee..a43ec1f 100644 --- a/src/main/java/fr/imirhil/april/hebdobot/Bot.java +++ b/src/main/java/fr/imirhil/april/hebdobot/Bot.java @@ -45,10 +45,10 @@ public class Bot extends PircBot { this.startCollectiveTopic(sender, message); } else if (message.startsWith("#")) { this.startIndividualTopic(sender, message); - } else if (message.startsWith("%")) { - this.addToCurrentTopic(raw); } else if (message.startsWith("!")) { - this.handleCommand(message.replaceFirst("!", "")); + this.handleCommand(message); + } else if (!message.startsWith("%")) { + this.addToCurrentTopic(raw); } } @@ -58,7 +58,8 @@ public class Bot extends PircBot { } } - private void handleCommand(final String message) { + private void handleCommand(String message) { + message = message.replaceFirst("!", ""); if (message.startsWith("courant")) { if (this.currentTopic != null) { this.sendMessage(this.channel, "Topic courant : "