delay post only is there is an attachment

This commit is contained in:
cquest 2022-12-14 16:48:14 +01:00
parent b2185b6434
commit af8ff73fd1

View File

@ -288,8 +288,9 @@ else:
if tags:
c = c + '\n' + tags
if toot_media is not None:
try:
if len(toot_media)>0:
time.sleep(5)
toot = mastodon_api.status_post(c,
in_reply_to_id=None,
media_ids=toot_media,
@ -311,6 +312,7 @@ else:
if "id" in toot:
db.execute("INSERT INTO tweets VALUES ( ? , ? , ? , ? , ? )", (id, toot["id"], source, mastodon, instance))
sql.commit()
print(source, ": tweet created at",t['created_at'])
print("---------------------------")
print()