preventing initial filling of queue when already connected

This commit is contained in:
2021-11-06 00:30:51 +01:00
parent f8e72443f4
commit 4bf90f9423
+5 -1
View File
@@ -113,7 +113,6 @@ class Music(commands.Cog):
# Get the results for the query from Lavalink. # Get the results for the query from Lavalink.
for query in queries: for query in queries:
result = await player.node.get_tracks(query) result = await player.node.get_tracks(query)
print(result)
if not result or not result["tracks"]: if not result or not result["tracks"]:
continue continue
@@ -218,6 +217,11 @@ class Music(commands.Cog):
"""Starts playing Christmas bangers""" """Starts playing Christmas bangers"""
# Get the player for this guild from cache. # Get the player for this guild from cache.
player: DefaultPlayer = self.bot.lavalink.player_manager.get(ctx.guild.id) player: DefaultPlayer = self.bot.lavalink.player_manager.get(ctx.guild.id)
if player.is_connected:
await ctx.send("Already connected")
return
await self.fill_player_queue(player, self.bot.config["queue_buffer_size"]) await self.fill_player_queue(player, self.bot.config["queue_buffer_size"])
if not player.is_playing: if not player.is_playing: