From c65bfa0c7d04c75d1401377811ddf62c9978d6f8 Mon Sep 17 00:00:00 2001 From: xfnw Date: Thu, 11 Nov 2021 19:56:05 -0500 Subject: [PATCH] do not specify explicit delimiter for split this interestingly makes python drop consecutive spaces, so the bot will not store empty "words" --- modules/nlp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/nlp.py b/modules/nlp.py index eeb14b5..64da7c7 100644 --- a/modules/nlp.py +++ b/modules/nlp.py @@ -17,7 +17,7 @@ async def rec(self, m): beg = shared.db['beg'] end = shared.db['end'] - words = m.split(' ') + words = m.split() if words[0] == 'admin' or len(words) < 2: return @@ -110,7 +110,7 @@ async def filter(self, c, n, m): elif '#' not in c and n != self.nickname: await go(self, c, n, m) else: - if len(m.split(' ')) > 1: + if len(m.split()) > 1: if shared.learntime + shared.learndelay < time.time(): await rec(self, m) shared.learntime = time.time()