Upload files to "/"

master
Guzzy 2023-11-15 06:05:31 +00:00
parent c483076c84
commit ad48552196
1 changed files with 28 additions and 0 deletions

28
update_marseys.py 100644
View File

@ -0,0 +1,28 @@
import os, shutil
import requests, zipfile, io
import time, schedule
#directory for marsey folder
bot_dir = os.path.dirname(__file__)
old_folder_dir = os.path.join(bot_dir, 'emojis')
new_folder_dir = os.path.join(bot_dir, 'emojis2')
#url for zip file
zip_url = 'https://rdrama.net/assets/emojis.zip'
# function to update marseys
def get_new_marseys():
r = requests.get(zip_url)
z = zipfile.ZipFile(io.BytesIO(r.content))
z.extractall(new_folder_dir)
shutil.rmtree(old_folder_dir)
os.rename(new_folder_dir, old_folder_dir)
print('updated successfully')
return
#updates everyday at 7 am
schedule.every().day.at("07:00").do(get_new_marseys)
while True:
schedule.run_pending()
time.sleep(1) # wait one minute