fix: fixed uploading the file
This commit is contained in:
parent
3ee121cbf2
commit
efa8c150ed
1 changed files with 1 additions and 2 deletions
|
@ -88,10 +88,9 @@ class MusicDownloader(commands.Cog):
|
||||||
msg = ctx.send
|
msg = ctx.send
|
||||||
message = await msg("YouTube Downloader started!")
|
message = await msg("YouTube Downloader started!")
|
||||||
filename = youtube_download(self, url, data_path, message)
|
filename = youtube_download(self, url, data_path, message)
|
||||||
filename_str = str(filename)
|
|
||||||
full_filename = os.path.join(data_path, filename)
|
full_filename = os.path.join(data_path, filename)
|
||||||
while not os.path.isfile(full_filename):
|
while not os.path.isfile(full_filename):
|
||||||
await asyncio.sleep(0.5)
|
await asyncio.sleep(0.5)
|
||||||
if os.path.isfile(full_filename):
|
if os.path.isfile(full_filename):
|
||||||
with open(full_filename, 'rb') as file:
|
with open(full_filename, 'rb') as file:
|
||||||
await ctx.send(content="YouTube Downloader completed!\nDownloaded file:", file=discord.File(file, {filename_str}))
|
await ctx.send(content="YouTube Downloader completed!\nDownloaded file:", file=discord.File(file, filename))
|
||||||
|
|
Loading…
Reference in a new issue