]> git.donarmstrong.com Git - infobot.git/blobdiff - src/Factoids/Question.pl
prefer chan specific commands
[infobot.git] / src / Factoids / Question.pl
index 276f9e8c5ea402115ac51d3d99f17855f2f51a03..06f81346f49d7b85173b76f602046e380464a86a 100644 (file)
@@ -221,7 +221,9 @@ sub factoidArgs {
     # the factoid key to reduce repetitive processing.
 
     # it does not matter if it's not alphabetically sorted.
-    foreach ( sort { length($b) <=> length($a) } @list ) {
+    foreach ( (sort { length($b) <=> length($a) } grep {$_ =~ /^\Q$chan \E/} @list),
+              (sort { length($b) <=> length($a) } grep {$_ !~ /^\Q$chan \E/} @list)
+            ) {
         next if (/#DEL#/);    # deleted.
 
         s/^\Q$chan \E//i;