mirror of
https://gitlab.com/oloturia/fumcaso.git
synced 2025-01-08 22: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)
|
mastodon.status_post(config["text"],media_ids=new_strip)
|
||||||
else:
|
else:
|
||||||
mastodon.status_post(user+" "+config["text"],media_ids=new_strip,visibility="direct")
|
mastodon.status_post(user+" "+config["text"],media_ids=new_strip,visibility="direct")
|
||||||
|
os.remove(config["saveLocation"]+config["filename"]
|
||||||
published = True
|
published = True
|
||||||
except:
|
except:
|
||||||
continue
|
continue
|
||||||
|
|
|
@ -15,6 +15,7 @@ def newStrip(bot, update, args):
|
||||||
strip_file=open(config["saveLocation"]+config["filename"],"rb")
|
strip_file=open(config["saveLocation"]+config["filename"],"rb")
|
||||||
bot.send_photo(chat_id=update.message.chat_id,photo=strip_file)
|
bot.send_photo(chat_id=update.message.chat_id,photo=strip_file)
|
||||||
strip_file.close()
|
strip_file.close()
|
||||||
|
os.remove(config["saveLocation"]+config["filename"])
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
print(err)
|
print(err)
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -27,9 +27,11 @@ if __name__ == "__main__":
|
||||||
api.verify_credentials()
|
api.verify_credentials()
|
||||||
api.update_with_media(config["saveLocation"]+config["filename"],config["text"])
|
api.update_with_media(config["saveLocation"]+config["filename"],config["text"])
|
||||||
published = True
|
published = True
|
||||||
|
os.remove(config["saveLocation"]+config["filename"]
|
||||||
except:
|
except:
|
||||||
continue
|
continue
|
||||||
break
|
break
|
||||||
|
|
||||||
if not(published):
|
if not(published):
|
||||||
print("Auth error")
|
print("Auth error")
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue