mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-21 18:27:59 -05:00
[Audio] Track search and append fixes (#2591)
* [Audio] Track search and append fixes * Appeasing the style gods
This commit is contained in:
@@ -1183,7 +1183,11 @@ class Audio(commands.Cog):
|
||||
player = lavalink.get_player(ctx.guild.id)
|
||||
guild_data = await self.config.guild(ctx.guild).all()
|
||||
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}"
|
||||
tracks = await player.get_tracks(query)
|
||||
if not tracks:
|
||||
@@ -1401,7 +1405,7 @@ class Audio(commands.Cog):
|
||||
pass
|
||||
|
||||
@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.
|
||||
|
||||
The track(s) will be appended to the end of the playlist.
|
||||
@@ -2014,7 +2018,6 @@ class Audio(commands.Cog):
|
||||
tracklist.append(track_obj)
|
||||
self._play_lock(ctx, False)
|
||||
elif not query.startswith("http"):
|
||||
query = " ".join(query)
|
||||
query = "ytsearch:{}".format(query)
|
||||
search = True
|
||||
tracks = await player.get_tracks(query)
|
||||
|
||||
Reference in New Issue
Block a user