Upload files to "/"
parent
c483076c84
commit
ad48552196
|
@ -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
|
Loading…
Reference in New Issue