diff options
author | Niklas Halle <niklas@niklashalle.net> | 2020-08-26 10:30:20 +0200 |
---|---|---|
committer | Niklas Halle <niklas@niklashalle.net> | 2020-08-26 10:30:20 +0200 |
commit | 523d168de503c210a42c24629d2524a98d4a3017 (patch) | |
tree | a6266b707b3a2b048929a1d732b7665be7184532 | |
parent | 6c2fa3b89434d489a26e1902f357a307322ce530 (diff) | |
download | n_frontend_signal-523d168de503c210a42c24629d2524a98d4a3017.tar.gz n_frontend_signal-523d168de503c210a42c24629d2524a98d4a3017.zip |
only format the current text, not all of it
-rwxr-xr-x | main.py | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -38,26 +38,27 @@ def handle_response(response): replies = response.json()['reply'] for reply in replies: # handle annotations - answer += reply['text'] + local_answer = reply['text'] for annotation in reply["annotations"]: atype = annotation["type"] aextra = annotation["extra"] if atype == "command": - answer = f"/{answer}: " + answer = f"/{local_answer}: " break elif atype == "link": - answer = f"{aextra} ({answer})" + answer = f"{aextra} ({local_answer})" break elif atype == "bold": - answer = f"*{answer}*" + answer = f"*{local_answer}*" break elif atype == "italic": - answer = f"_{answer}_" + answer = f"_{local_answer}_" break elif atype == "strikethrough": - answer = f"~{answer}~" + answer = f"~{local_answer}~" break + answer += local_answer return answer |