Fix history reducing alghorithm

This commit is contained in:
OK 2023-04-13 12:58:55 +02:00
parent 0791825e01
commit bcfe0e968f

View File

@ -215,7 +215,7 @@ class AIResponder(object):
del self.history[0] del self.history[0]
else: else:
current = self.history[index] current = self.history[index]
count = sum(1 for item in self.history[index:] if item.get('channel') == current.get('channel')) count = sum(1 for item in self.history if item.get('channel') == current.get('channel'))
if count > self.config.get('history-per-channel', 3): if count > self.config.get('history-per-channel', 3):
del self.history[index] del self.history[index]
else: else: