mirror of
https://gitlab.com/oloturia/fumcaso.git
synced 2025-01-06 21:47:17 +01:00
removes file after post
This commit is contained in:
parent
e239f22991
commit
19685ed4e8
3 changed files with 4 additions and 0 deletions
|
@ -25,6 +25,7 @@ def publishStrip(altProfile=False,user=False):
|
|||
mastodon.status_post(config["text"],media_ids=new_strip)
|
||||
else:
|
||||
mastodon.status_post(user+" "+config["text"],media_ids=new_strip,visibility="direct")
|
||||
os.remove(config["saveLocation"]+config["filename"]
|
||||
published = True
|
||||
except:
|
||||
continue
|
||||
|
|
|
@ -15,6 +15,7 @@ def newStrip(bot, update, args):
|
|||
strip_file=open(config["saveLocation"]+config["filename"],"rb")
|
||||
bot.send_photo(chat_id=update.message.chat_id,photo=strip_file)
|
||||
strip_file.close()
|
||||
os.remove(config["saveLocation"]+config["filename"])
|
||||
except Exception as err:
|
||||
print(err)
|
||||
else:
|
||||
|
|
|
@ -27,9 +27,11 @@ if __name__ == "__main__":
|
|||
api.verify_credentials()
|
||||
api.update_with_media(config["saveLocation"]+config["filename"],config["text"])
|
||||
published = True
|
||||
os.remove(config["saveLocation"]+config["filename"]
|
||||
except:
|
||||
continue
|
||||
break
|
||||
|
||||
if not(published):
|
||||
print("Auth error")
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue