@@ -92,7 +92,7 @@ async def help_autocomplete(self, interaction: discord.Interaction, current: str
92
92
return [app_commands .Choice (name = c .capitalize (), value = c ) for c in self .bot .cogs if c not in ["Nodes" , "Task" ] and current in c ]
93
93
94
94
async def play_autocomplete (self , interaction : discord .Interaction , current : str ) -> list :
95
- if voicelink .pool .URL_REGEX .match (current ): return []
95
+ if voicelink .pool .URL_REGEX .match (current ): return [app_commands . Choice ( name = current , value = current ) ]
96
96
97
97
history : dict [str , str ] = {}
98
98
for track_id in reversed (await get_user (interaction .user .id , "history" )):
@@ -107,9 +107,9 @@ async def play_autocomplete(self, interaction: discord.Interaction, current: str
107
107
if node and node .spotify_client :
108
108
try :
109
109
tracks : list [voicelink .Track ] = await node .spotifySearch (current , requester = interaction .user )
110
- return history_tracks [: 5 ] + [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 ]
110
+ 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 ]
111
111
except voicelink .TrackLoadError :
112
- return history_tracks
112
+ return []
113
113
114
114
@commands .hybrid_command (name = "connect" , aliases = get_aliases ("connect" ))
115
115
@app_commands .describe (channel = "Provide a channel to connect." )
0 commit comments