Fix bug in filtering replies
This commit is contained in:
parent
c239dcf489
commit
3beb10075f
1 changed files with 1 additions and 1 deletions
2
main.py
2
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")
|
||||
|
|
Loading…
Reference in a new issue