From c9431f7d90708c4e3a91ca5f4f5873ce61456ec9 Mon Sep 17 00:00:00 2001 From: DeltaX <33706469+DeltaXWizard@users.noreply.github.com> Date: Tue, 18 May 2021 18:09:32 -0400 Subject: [PATCH] [Audio] Fix local track documentation. (#4832) Co-authored-by: Draper <27962761+Drapersniper@users.noreply.github.com> --- .../cogs/audio/core/commands/localtracks.py | 26 ++++++++++++++++--- redbot/cogs/audio/core/commands/player.py | 6 ++++- .../cogs/audio/core/utilities/formatting.py | 2 +- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/redbot/cogs/audio/core/commands/localtracks.py b/redbot/cogs/audio/core/commands/localtracks.py index 18b0cc487..bf632c3bb 100644 --- a/redbot/cogs/audio/core/commands/localtracks.py +++ b/redbot/cogs/audio/core/commands/localtracks.py @@ -27,7 +27,15 @@ class LocalTrackCommands(MixinMeta, metaclass=CompositeMetaClass): @command_local.command(name="folder", aliases=["start"]) async def command_local_folder(self, ctx: commands.Context, *, folder: str = None): - """Play all songs in a localtracks folder.""" + """Play all songs in a localtracks folder. + + **Usage**: + ​ ​ ​ ​ `[p]local folder` + ​ ​ ​ ​ ​ ​ ​ ​ Open a menu to pick a folder to queue. + + ​ ​ `[p]local folder folder_name` + ​ ​ ​ ​ ​ ​ ​ ​ Queues all of the tracks inside the folder_name folder. + """ if not await self.localtracks_folder_exists(ctx): return @@ -47,11 +55,23 @@ class LocalTrackCommands(MixinMeta, metaclass=CompositeMetaClass): query = Query.process_input( _dir, self.local_folder_current_path, search_subfolders=True ) - await self._local_play_all(ctx, query, from_search=False if not folder else True) + await self._local_play_all(ctx, query, from_search=bool(folder)) @command_local.command(name="play") async def command_local_play(self, ctx: commands.Context): - """Play a local track.""" + """Play a local track. + + To play a local track, either use the menu to choose a track or enter in the track path directly with the play command. + To play an entire folder, use `[p]help local folder` for instructions. + + **Usage**: + ​ ​ ​ ​ `[p]local play` + ​ ​ ​ ​ ​ ​ ​ ​ Open a menu to pick a track. + + ​ ​ ​ ​ `[p]play localtracks\\album_folder\\song_name.mp3` + ​ ​ ​ ​ `[p]play album_folder\\song_name.mp3` + ​ ​ ​ ​ ​ ​ ​ ​ Use a direct link relative to the localtracks folder. + """ if not await self.localtracks_folder_exists(ctx): return localtracks_folders = await self.get_localtracks_folders(ctx, search_subfolders=True) diff --git a/redbot/cogs/audio/core/commands/player.py b/redbot/cogs/audio/core/commands/player.py index ed6593893..8b15bdb49 100644 --- a/redbot/cogs/audio/core/commands/player.py +++ b/redbot/cogs/audio/core/commands/player.py @@ -37,7 +37,11 @@ class PlayerCommands(MixinMeta, metaclass=CompositeMetaClass): @commands.guild_only() @commands.bot_has_permissions(embed_links=True) async def command_play(self, ctx: commands.Context, *, query: str): - """Play a URL or search for a track.""" + """Play the specified track or search for a close match. + + To play a local track, the query should be `\\`. + If you are the bot owner, use `[p]audioset info` to display your localtracks path. + """ query = Query.process_input(query, self.local_folder_current_path) guild_data = await self.config.guild(ctx.guild).all() restrict = await self.config.restrict() diff --git a/redbot/cogs/audio/core/utilities/formatting.py b/redbot/cogs/audio/core/utilities/formatting.py index 427e1881e..b89519983 100644 --- a/redbot/cogs/audio/core/utilities/formatting.py +++ b/redbot/cogs/audio/core/utilities/formatting.py @@ -93,7 +93,7 @@ class FormattingUtilities(MixinMeta, metaclass=CompositeMetaClass): ): if not self._player_check(ctx): if self.lavalink_connection_aborted: - msg = _("Connection to Lavalink has failed.") + msg = _("Connection to Lavalink has failed") description = EmptyEmbed if await self.bot.is_owner(ctx.author): description = _("Please check your console or logs for details.")