diff --git a/main.py b/main.py index ab66464..0cd8126 100644 --- a/main.py +++ b/main.py @@ -369,7 +369,7 @@ async def reaction_callback(room: nio.MatrixRoom, event: nio.UnknownEvent, react original_body = reacted_to_event.body # If the message was a reply if reacted_to_event.source.get("content", {}).get("m.relates_to", {}).get("m.in_reply_to", {}).get("event_id"): - original_body = "\n\n".join(reacted_to_event.split("\n\n")[1:]) # Remove the in reply to part + original_body = "\n\n".join(reacted_to_event.body.split("\n\n")[1:]) # Remove the in reply to part translated = lt.translate(original_body, from_lang, "en") lang = lt.detect(reacted_to_event.body)[0]["language"].upper() if from_lang == "auto" else from_lang.upper() return await send_reply(room.room_id, reacted_to_event, "Translated from " + lang + " (" + flag_emoji("US" if lang == "EN" else lang) + "):\n" + translated + "\n")