fix(youtubedownloader): fixed erroring when deleting a downloaded file
All checks were successful
Pylint / Pylint (3.10) (push) Successful in 53s

This commit is contained in:
Seaswimmer 2023-11-26 12:33:52 -05:00
parent 85585d4988
commit f3fd4a8311
Signed by: cswimr
GPG key ID: 1EBC234EEDA901AE

View file

@ -120,7 +120,7 @@ class YouTubeDownloader(commands.Cog):
file.close()
if delete is True or await self.bot.is_owner(ctx.author) is False:
if output[1] is False:
os.remove(output)
os.remove(output[0])
await complete_message.edit(content="YouTube Downloader completed!\nFile has been deleted.\nDownloaded file:")
if output[1] is True:
await complete_message.edit(content="YouTube Downloader completed!\nFile has not been deleted, as it was previously downloaded and saved.\nDownloaded file:")