fix: added handling for if no data path is provided in change_data_path
This commit is contained in:
parent
f510a54183
commit
1aca41b5c9
1 changed files with 2 additions and 0 deletions
|
@ -18,6 +18,8 @@ class MusicDownloader(commands.Cog):
|
|||
async def change_data_path(self, ctx: commands.Context, data_path: str = None):
|
||||
"""This command changes the data path this cog outputs to."""
|
||||
old_path = await self.config.save_directory()
|
||||
if not data_path:
|
||||
await ctx.send(f"The current data path is `{old_path}`.")
|
||||
if os.path.isdir(data_path):
|
||||
await self.config.save_directory.set(data_path)
|
||||
embed=discord.Embed(color=await self.bot.get_embed_color(None), description=f"The save directory has been set to `{data_path}`.\n It was previously set to `{old_path}`.")
|
||||
|
|
Loading…
Reference in a new issue