do not specify explicit delimiter for split

this interestingly makes python drop consecutive spaces, so the bot will
not store empty "words"
This commit is contained in:
xfnw 2021-11-11 19:56:05 -05:00
parent 1d915a8e7e
commit c65bfa0c7d

View file

@ -17,7 +17,7 @@ async def rec(self, m):
beg = shared.db['beg'] beg = shared.db['beg']
end = shared.db['end'] end = shared.db['end']
words = m.split(' ') words = m.split()
if words[0] == 'admin' or len(words) < 2: if words[0] == 'admin' or len(words) < 2:
return return
@ -110,7 +110,7 @@ async def filter(self, c, n, m):
elif '#' not in c and n != self.nickname: elif '#' not in c and n != self.nickname:
await go(self, c, n, m) await go(self, c, n, m)
else: else:
if len(m.split(' ')) > 1: if len(m.split()) > 1:
if shared.learntime + shared.learndelay < time.time(): if shared.learntime + shared.learndelay < time.time():
await rec(self, m) await rec(self, m)
shared.learntime = time.time() shared.learntime = time.time()