Update database bot.py

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

View file

@ -135,6 +135,10 @@ async def getsound(ctx):
@client.command() @client.command()
async def downloadcharacter(ctx): async def downloadcharacter(ctx):
filepath = ctx.message.content[19:] filepath = ctx.message.content[19:]
if filepath == '':
filepath = 'something that does not exist'
else:
pass
fullfilepath = 'public/singlecharacter/'+str(filepath) fullfilepath = 'public/singlecharacter/'+str(filepath)
if os.path.isdir(fullfilepath): if os.path.isdir(fullfilepath):
await ctx.send("grabbing the character please wait") await ctx.send("grabbing the character please wait")
@ -145,7 +149,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:47746/"+str(newurlpath)) await ctx.send("http://fierce-push.auto.playit.gg:47746/"+str(urlpath))
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()