[Audio] Fix local track documentation. (#4832)

Co-authored-by: Draper <27962761+Drapersniper@users.noreply.github.com>
This commit is contained in:
DeltaX 2021-05-18 18:09:32 -04:00 committed by GitHub
parent cb45ef6c42
commit c9431f7d90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 5 deletions

View File

@ -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)

View File

@ -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 `<parentfolder>\\<filename>`.
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()

View File

@ -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.")