Make history messages per channel configurable

This commit is contained in:
OK 2023-04-12 12:23:41 +02:00
parent 2db983c462
commit 77fe7a69d6

View File

@ -207,7 +207,7 @@ class AIResponder(object):
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[index:] if item.get('channel') == current.get('channel'))
if count > 3: if count > self.config.get('history-per-channel', 3):
del self.history[index] del self.history[index]
else: else:
self.shrink_history_by_one(index + 1) self.shrink_history_by_one(index + 1)