autoresponder.py doesn't function correctly after a reboot if there are replies queued up. Put differently, after a reboot, if autoresponder.py finds a message waiting, it errors and stops running. This is the error:
Traceback (most recent call last):
File "/home/pi/botcode/./autoresponder.py", line 174, in <module>
respond_to_mentions(read_state())
File "/home/pi/botcode/./autoresponder.py", line 157, in respond_to_mentions
create_and_post_reply(soup.get_text().replace("@semantic_distorter", ""), mention.status.id, mention.account.acct)
File "/home/pi/botcode/./autoresponder.py", line 94, in create_and_post_reply
translated_text = semantic_distorter.translate(text_to_translate, translate_from_language, translate_to_language, config["translation_endpoint_url"])
File "/home/pi/botcode/semantic_distorter.py", line 51, in translate
return translated_object["translatedText"]
KeyError: 'translatedText'
Best guess is that libretranslate isn't ready yet.
manually running autoresponder.py from the shell after reboot will clear the waiting replies & then it will function fine -- after another reboot to relaunch the cron.
autoresponder.py
doesn't function correctly after a reboot if there are replies queued up. Put differently, after a reboot, ifautoresponder.py
finds a message waiting, it errors and stops running. This is the error:Best guess is that libretranslate isn't ready yet.