Skip to content

Commit

Permalink
feat(lava/cogs/commands.py): update track retrieval logic for local s…
Browse files Browse the repository at this point in the history
…ources and Lavalink
  • Loading branch information
Nat1anWasTaken committed Jun 9, 2024
1 parent bb6483b commit f198779
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lava/cogs/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,12 @@ async def play(self, interaction: ApplicationCommandInteraction, query: str, ind
interaction.guild.id
)

results: LoadResult = await player.node.get_tracks(query)
results: LoadResult = await self.bot.lavalink.get_local_tracks(query)

# Check locals
if not results or not results.tracks:
self.bot.logger.info("No results found with lavalink for query %s, checking local sources", query)
results: LoadResult = await self.bot.lavalink.get_local_tracks(query)
self.bot.logger.info("No results found with local sources for query %s, checking on lavalink", query)
results: LoadResult = await player.node.get_tracks(query)

if not results or not results.tracks: # If nothing was found
return await interaction.edit_original_response(
Expand Down

0 comments on commit f198779

Please sign in to comment.