From 6d3faf178a89ebad3251256068c06d01db96f715 Mon Sep 17 00:00:00 2001 From: Jon Michael Aanes Date: Fri, 8 Jun 2018 19:12:13 +0200 Subject: [PATCH] Less chance of silly 1-comparison. --- main.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main.lua b/main.lua index 91dd937..8990e3e 100644 --- a/main.lua +++ b/main.lua @@ -424,12 +424,15 @@ local function get_topics_from_comparison_message(message) if comp then local topics = {} for topic in message:gmatch('[^'..comp..']+') do - topics[#topics+1] = clean_text(topic) + local topic_text = clean_text(topic) + if topic_text:match '[^%s]' then + topics[#topics+1] = topic_text + end end -- Rev if comp == '>' then topics = reverse(topics) end -- - return topics + return (#topics >= 2) and topics or nil end -- Natural language comparisons