mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -05:00
[Audio] Fix local track documentation. (#4832)
Co-authored-by: Draper <27962761+Drapersniper@users.noreply.github.com>
This commit is contained in:
parent
cb45ef6c42
commit
c9431f7d90
@ -27,7 +27,15 @@ class LocalTrackCommands(MixinMeta, metaclass=CompositeMetaClass):
|
|||||||
|
|
||||||
@command_local.command(name="folder", aliases=["start"])
|
@command_local.command(name="folder", aliases=["start"])
|
||||||
async def command_local_folder(self, ctx: commands.Context, *, folder: str = None):
|
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):
|
if not await self.localtracks_folder_exists(ctx):
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -47,11 +55,23 @@ class LocalTrackCommands(MixinMeta, metaclass=CompositeMetaClass):
|
|||||||
query = Query.process_input(
|
query = Query.process_input(
|
||||||
_dir, self.local_folder_current_path, search_subfolders=True
|
_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")
|
@command_local.command(name="play")
|
||||||
async def command_local_play(self, ctx: commands.Context):
|
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):
|
if not await self.localtracks_folder_exists(ctx):
|
||||||
return
|
return
|
||||||
localtracks_folders = await self.get_localtracks_folders(ctx, search_subfolders=True)
|
localtracks_folders = await self.get_localtracks_folders(ctx, search_subfolders=True)
|
||||||
|
|||||||
@ -37,7 +37,11 @@ class PlayerCommands(MixinMeta, metaclass=CompositeMetaClass):
|
|||||||
@commands.guild_only()
|
@commands.guild_only()
|
||||||
@commands.bot_has_permissions(embed_links=True)
|
@commands.bot_has_permissions(embed_links=True)
|
||||||
async def command_play(self, ctx: commands.Context, *, query: str):
|
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)
|
query = Query.process_input(query, self.local_folder_current_path)
|
||||||
guild_data = await self.config.guild(ctx.guild).all()
|
guild_data = await self.config.guild(ctx.guild).all()
|
||||||
restrict = await self.config.restrict()
|
restrict = await self.config.restrict()
|
||||||
|
|||||||
@ -93,7 +93,7 @@ class FormattingUtilities(MixinMeta, metaclass=CompositeMetaClass):
|
|||||||
):
|
):
|
||||||
if not self._player_check(ctx):
|
if not self._player_check(ctx):
|
||||||
if self.lavalink_connection_aborted:
|
if self.lavalink_connection_aborted:
|
||||||
msg = _("Connection to Lavalink has failed.")
|
msg = _("Connection to Lavalink has failed")
|
||||||
description = EmptyEmbed
|
description = EmptyEmbed
|
||||||
if await self.bot.is_owner(ctx.author):
|
if await self.bot.is_owner(ctx.author):
|
||||||
description = _("Please check your console or logs for details.")
|
description = _("Please check your console or logs for details.")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user