mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-07 11:48:55 -05:00
[Audio] Track search and append fixes (#2591)
* [Audio] Track search and append fixes * Appeasing the style gods
This commit is contained in:
parent
13611e34d2
commit
bb8ce43cc0
@ -1183,7 +1183,11 @@ class Audio(commands.Cog):
|
|||||||
player = lavalink.get_player(ctx.guild.id)
|
player = lavalink.get_player(ctx.guild.id)
|
||||||
guild_data = await self.config.guild(ctx.guild).all()
|
guild_data = await self.config.guild(ctx.guild).all()
|
||||||
if type(query) is not list:
|
if type(query) is not list:
|
||||||
if not (query.startswith("http") or query.startswith("localtracks")):
|
if not (
|
||||||
|
query.startswith("http")
|
||||||
|
or query.startswith("localtracks")
|
||||||
|
or query.startswith("ytsearch:")
|
||||||
|
):
|
||||||
query = f"ytsearch:{query}"
|
query = f"ytsearch:{query}"
|
||||||
tracks = await player.get_tracks(query)
|
tracks = await player.get_tracks(query)
|
||||||
if not tracks:
|
if not tracks:
|
||||||
@ -1401,7 +1405,7 @@ class Audio(commands.Cog):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
@playlist.command(name="append")
|
@playlist.command(name="append")
|
||||||
async def _playlist_append(self, ctx, playlist_name, *url):
|
async def _playlist_append(self, ctx, playlist_name, *, url):
|
||||||
"""Add a track URL, playlist link, or quick search to a playlist.
|
"""Add a track URL, playlist link, or quick search to a playlist.
|
||||||
|
|
||||||
The track(s) will be appended to the end of the playlist.
|
The track(s) will be appended to the end of the playlist.
|
||||||
@ -2014,7 +2018,6 @@ class Audio(commands.Cog):
|
|||||||
tracklist.append(track_obj)
|
tracklist.append(track_obj)
|
||||||
self._play_lock(ctx, False)
|
self._play_lock(ctx, False)
|
||||||
elif not query.startswith("http"):
|
elif not query.startswith("http"):
|
||||||
query = " ".join(query)
|
|
||||||
query = "ytsearch:{}".format(query)
|
query = "ytsearch:{}".format(query)
|
||||||
search = True
|
search = True
|
||||||
tracks = await player.get_tracks(query)
|
tracks = await player.get_tracks(query)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user