Replaced internal spotify with lavalink

This commit is contained in:
Choco
2025-03-22 18:42:28 +08:00
parent 7e8bfb6e33
commit 5498c60466
15 changed files with 29 additions and 601 deletions

View File

@@ -90,9 +90,9 @@ class Basic(commands.Cog):
if current:
node = voicelink.NodePool.get_node()
if node and node.spotify_client:
if node:
try:
tracks: list[voicelink.Track] = await node.spotifySearch(current, requester=interaction.user)
tracks: list[voicelink.Track] = await node.get_tracks(current, requester=interaction.user, search_type=SearchType.SPOTIFY)
return [app_commands.Choice(name=truncate_string(f"🎵 {track.author} - {track.title}", 100), value=truncate_string(f"{track.author} - {track.title}", 100)) for track in tracks]
except voicelink.TrackLoadError:
return []