aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--cogs/music/play_commands.py4
-rw-r--r--cogs/voice.py13
2 files changed, 10 insertions, 7 deletions
diff --git a/cogs/music/play_commands.py b/cogs/music/play_commands.py
index a24169f..e90d85f 100644
--- a/cogs/music/play_commands.py
+++ b/cogs/music/play_commands.py
@@ -109,7 +109,7 @@ class PlayCommands(commands.Cog):
109 if len(display) > 90: 109 if len(display) > 90:
110 display = display[:87] + "..." 110 display = display[:87] + "..."
111 111
112 choices.append(OptionChoice(display[:100], display[:100])) 112 choices.append(OptionChoice(display[:100], url))
113 113
114 if len(choices) >= 25: 114 if len(choices) >= 25:
115 break 115 break
@@ -167,7 +167,7 @@ class PlayCommands(commands.Cog):
167 self, ctx: discord.ApplicationContext, file: str, compressed: bool 167 self, ctx: discord.ApplicationContext, file: str, compressed: bool
168 ) -> None: 168 ) -> None:
169 """Handle file playback from copyparty URL.""" 169 """Handle file playback from copyparty URL."""
170 url = self.path_mapping.get(file, file) 170 url = file # The option value is now the URL directly
171 171
172 if compressed: 172 if compressed:
173 await self._handle_compressed_file_play(ctx, url) 173 await self._handle_compressed_file_play(ctx, url)
diff --git a/cogs/voice.py b/cogs/voice.py
index 316de7b..b6b504a 100644
--- a/cogs/voice.py
+++ b/cogs/voice.py
@@ -94,11 +94,14 @@ class VoiceManager:
94 audio_source = discord.PCMVolumeTransformer(audio_source) 94 audio_source = discord.PCMVolumeTransformer(audio_source)
95 audio_source.volume = volume 95 audio_source.volume = volume
96 96
97 voice_client.play(audio_source) 97 try:
98 98 voice_client.play(audio_source)
99 while voice_client.is_playing(): 99 while voice_client.is_playing():
100 await asyncio.sleep(0.1) 100 await asyncio.sleep(0.1)
101 return True 101 return True
102 except Exception as e:
103 logger.error(f"Error playing audio: {e}")
104 return False
102 105
103 async def stop(self, guild): 106 async def stop(self, guild):
104 """Stop playing and disconnect from voice.""" 107 """Stop playing and disconnect from voice."""