Handle replying to aa missing post
This commit is contained in:
parent
48390aa3f2
commit
c3b1952a79
1 changed files with 10 additions and 7 deletions
3
scl.py
3
scl.py
|
@ -373,6 +373,7 @@ with Session(engine) as session:
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
if max_event_class["is_postable"] and existing_record.initial_post_id:
|
if max_event_class["is_postable"] and existing_record.initial_post_id:
|
||||||
|
try:
|
||||||
post_result = mastodon_client.status_post(
|
post_result = mastodon_client.status_post(
|
||||||
status="\n".join(updated_entries),
|
status="\n".join(updated_entries),
|
||||||
in_reply_to_id=existing_record.most_recent_post_id,
|
in_reply_to_id=existing_record.most_recent_post_id,
|
||||||
|
@ -380,6 +381,8 @@ with Session(engine) as session:
|
||||||
language="en",
|
language="en",
|
||||||
)
|
)
|
||||||
existing_record.most_recent_post_id = post_result["id"]
|
existing_record.most_recent_post_id = post_result["id"]
|
||||||
|
except mastodon.MastodonNotFoundError:
|
||||||
|
print("Could not post a reply to the existing post, skip this update")
|
||||||
elif max_event_class["is_postable"]:
|
elif max_event_class["is_postable"]:
|
||||||
print(
|
print(
|
||||||
"Posting an event that grew above the threshold required to post"
|
"Posting an event that grew above the threshold required to post"
|
||||||
|
|
Loading…
Reference in a new issue