From de9c32359d82d4dd48b712a4330e854b7b802d4e Mon Sep 17 00:00:00 2001 From: Hendrik Langer Date: Sun, 2 Apr 2023 22:37:50 +0200 Subject: [PATCH] count messages --- matrix_pygmalion_bot/core.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/matrix_pygmalion_bot/core.py b/matrix_pygmalion_bot/core.py index 1205315..5076546 100644 --- a/matrix_pygmalion_bot/core.py +++ b/matrix_pygmalion_bot/core.py @@ -175,7 +175,9 @@ class Callbacks(object): await self.bot.send_message(self.client, room.room_id, translated_answer, reply_to=chat_message.event_id, original_message=answer) else: await self.bot.send_message(self.client, room.room_id, answer, reply_to=chat_message.event_id) - + if not "message_count" in self.room_config[room_id]: + self.room_config[room_id]["message_count"] = 0 + self.room_config[room_id]["message_count"] += 1 async def invite_cb(self, room: MatrixRoom, event: InviteEvent) -> None: