remove trailing \1 if message does not start with \1 (fixes #1)

This commit is contained in:
xfnw 2021-08-03 20:45:16 -04:00
parent 38bda3aa43
commit e82c66e22b

View file

@ -95,7 +95,10 @@ async def go(self, c, n, m):
words = re.sub(r'([\.,\?!])', r' \1', m).split() words = re.sub(r'([\.,\?!])', r' \1', m).split()
if words[0] == 'admin': if words[0] == 'admin':
return return
await self.message(c, re.sub(r' ([\.,\?!])', r'\1', ' '.join(await genOut(self, await getNoun(self, words, c))))) msg = re.sub(r' ([\.,\?!])', r'\1', ' '.join(await genOut(self, await getNoun(self, words, c))))
if msg[-1] == "\x01" and msg[0] != "\x01":
msg = msg[:-1]
await self.message(c, msg)
async def init(self): async def init(self):
@ -108,7 +111,7 @@ async def init(self):
# sentance ending weight, lower means longer sentances, # sentance ending weight, lower means longer sentances,
# higher means shorter sentances. this will need to slowly # higher means shorter sentances. this will need to slowly
# get larger as the database grows # get larger as the database grows
shared.enmul = 6 shared.enmul = 10
shared.rawm['nlp'] = filter shared.rawm['nlp'] = filter