diff --git a/matrix_pygmalion_bot/core.py b/matrix_pygmalion_bot/core.py index d8a5604..24821d0 100644 --- a/matrix_pygmalion_bot/core.py +++ b/matrix_pygmalion_bot/core.py @@ -257,11 +257,12 @@ class Callbacks(object): answer = await self.bot.text_ai.generate_sync(full_prompt, self.bot.runpod_api_key, self.bot, typing) answer = answer.strip() await self.client.room_typing(room.room_id, False) - if not (self.bot.translate is None): + if (self.bot.translate is None) or (self.bot.translate == "en"): + await self.bot.send_message(self.client, room.room_id, answer, reply_to=chat_message.event_id) + else: translated_answer = translate.translate(answer, "en", self.bot.translate) 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.bot.room_config[room.room_id]: self.bot.room_config[room.room_id]["message_count"] = 0 self.bot.room_config[room.room_id]["message_count"] += 1