Update database bot.py

This commit is contained in:
insert-usernamehere 2021-03-27 14:55:12 -04:00 committed by GitHub
parent feee9554e9
commit 276d7bcb58
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -17,7 +17,7 @@ def closefile():
else: else:
pass pass
def closefile(): def closefile1():
sleep(300) sleep(300)
if os.path.exists(finalfilepath1): if os.path.exists(finalfilepath1):
os.remove(finalfilepath1) os.remove(finalfilepath1)
@ -108,7 +108,7 @@ async def getchrasset(ctx):
filedirweburl = weburl.replace("%20", " ") filedirweburl = weburl.replace("%20", " ")
if os.path.isfile('public/singlecharacter/'+str(filedirweburl)): if os.path.isfile('public/singlecharacter/'+str(filedirweburl)):
betterweburl = weburl.replace(" ", "%20") betterweburl = weburl.replace(" ", "%20")
await ctx.send("http://fierce-push.auto.playit.gg:53368/singlecharacter/"+str(betterweburl)) await ctx.send("http://fierce-push.auto.playit.gg:47746/singlecharacter/"+str(betterweburl))
else: else:
await ctx.send("oops! that file does not exist make sure its spelled correctly") await ctx.send("oops! that file does not exist make sure its spelled correctly")
@ -118,7 +118,7 @@ async def getcortasset(ctx):
filedirweburl = weburl.replace("%20", " ") filedirweburl = weburl.replace("%20", " ")
if os.path.isfile('public/singlecharacter/'+str(filedirweburl)): if os.path.isfile('public/singlecharacter/'+str(filedirweburl)):
betterweburl = weburl.replace(" ", "%20") betterweburl = weburl.replace(" ", "%20")
await ctx.send("http://fierce-push.auto.playit.gg:53368/singlecourtroom/"+str(betterweburl)) await ctx.send("http://fierce-push.auto.playit.gg:47746/singlecourtroom/"+str(betterweburl))
else: else:
await ctx.send("oops! that file does not exist make sure its spelled correctly") await ctx.send("oops! that file does not exist make sure its spelled correctly")
@ -128,7 +128,7 @@ async def getsound(ctx):
sounddirweb = sound.replace("%20", " ") sounddirweb = sound.replace("%20", " ")
if os.path.isfile('public/singlesound/'+str(sounddirweb)): if os.path.isfile('public/singlesound/'+str(sounddirweb)):
bettersound = sound.replace(" ", "%20") bettersound = sound.replace(" ", "%20")
await ctx.send("http://fierce-push.auto.playit.gg:53368/singlesound/"+str(bettersound)) await ctx.send("http://fierce-push.auto.playit.gg:47746/singlesound/"+str(bettersound))
else: else:
await ctx.send("oops! that file does not exist make sure its spelled correctly") await ctx.send("oops! that file does not exist make sure its spelled correctly")
@ -145,7 +145,7 @@ async def downloadcharacter(ctx):
urlpath = finalfilepath.replace(" ", "_") urlpath = finalfilepath.replace(" ", "_")
os.rename(finalfilepath,urlpath) os.rename(finalfilepath,urlpath)
newurlpath = finalfilepath.replace("/public", "") newurlpath = finalfilepath.replace("/public", "")
await ctx.send("http://fierce-push.auto.playit.gg:53368/"+str(newurlpath)) await ctx.send("http://fierce-push.auto.playit.gg:47746/"+str(newurlpath))
await ctx.send("note: this link will become invalid in 5 minutes") await ctx.send("note: this link will become invalid in 5 minutes")
delfile = threading.Thread(target=closefile) delfile = threading.Thread(target=closefile)
delfile.start() delfile.start()
@ -171,7 +171,7 @@ async def downloadcourtroom(ctx):
urlpath = finalfilepath1.replace(" ", "_") urlpath = finalfilepath1.replace(" ", "_")
os.rename(finalfilepath1,urlpath) os.rename(finalfilepath1,urlpath)
newurlpath = finalfilepath1.replace("/public", "") newurlpath = finalfilepath1.replace("/public", "")
await ctx.send("http://fierce-push.auto.playit.gg:53368/"+str(newurlpath)) await ctx.send("http://fierce-push.auto.playit.gg:47746/"+str(newurlpath))
await ctx.send("note: this link will become invalid in 5 minutes") await ctx.send("note: this link will become invalid in 5 minutes")
delfile = threading.Thread(target=closefile1) delfile = threading.Thread(target=closefile1)
delfile.start() delfile.start()