mirror of
https://github.com/Matthww/TuneBot.git
synced 2026-09-21 23:37:47 +00:00
preventing initial filling of queue when already connected
This commit is contained in:
+5
-1
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user