aboutsummaryrefslogtreecommitdiffstats
path: root/cogs/music/play_commands.py
diff options
context:
space:
mode:
Diffstat (limited to 'cogs/music/play_commands.py')
-rw-r--r--cogs/music/play_commands.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/cogs/music/play_commands.py b/cogs/music/play_commands.py
index bdb021d..a90f901 100644
--- a/cogs/music/play_commands.py
+++ b/cogs/music/play_commands.py
@@ -16,10 +16,11 @@ import discord
16from discord.commands import OptionChoice 16from discord.commands import OptionChoice
17from discord.ext import commands 17from discord.ext import commands
18 18
19from cogs.music import audio_playback, media_processing 19from cogs.music import media_processing
20from cogs.utils.file_search import UniversalSearcher 20from cogs.utils.file_search import UniversalSearcher
21from cogs.utils.settings import get_uploadurl 21from cogs.utils.settings import get_uploadurl
22from cogs.utils.url_helper import clean_url_for_ytdlp 22from cogs.utils.url_helper import clean_url_for_ytdlp
23from cogs.voice import get_voice_manager
23 24
24logger = logging.getLogger(__name__) 25logger = logging.getLogger(__name__)
25 26
@@ -162,7 +163,7 @@ class PlayCommands(commands.Cog):
162 if not compressed_path: 163 if not compressed_path:
163 return 164 return
164 165
165 await audio_playback.AudioPlaybackManager.play( 166 await get_voice_manager(self.bot).play(
166 ctx, compressed_path, delete_after_play=True 167 ctx, compressed_path, delete_after_play=True
167 ) 168 )
168 except Exception as e: 169 except Exception as e:
@@ -209,7 +210,7 @@ class PlayCommands(commands.Cog):
209 210
210 upload_task = asyncio.create_task(self._upload_to_copyparty_async(local_path)) 211 upload_task = asyncio.create_task(self._upload_to_copyparty_async(local_path))
211 212
212 await audio_playback.AudioPlaybackManager.play( 213 await get_voice_manager(self.bot).play(
213 ctx, local_path, delete_after_play=True 214 ctx, local_path, delete_after_play=True
214 ) 215 )
215 216
@@ -274,7 +275,7 @@ class PlayCommands(commands.Cog):
274 if compressed: 275 if compressed:
275 await self._handle_compressed_file_play(ctx, url) 276 await self._handle_compressed_file_play(ctx, url)
276 else: 277 else:
277 await audio_playback.AudioPlaybackManager.play(ctx, url) 278 await get_voice_manager(self.bot).play(ctx, url)
278 279
279 @discord.slash_command(name="grajcuj", description="grajcujmy wszyscy!") 280 @discord.slash_command(name="grajcuj", description="grajcujmy wszyscy!")
280 async def play( 281 async def play(
@@ -309,7 +310,7 @@ class PlayCommands(commands.Cog):
309 if file: 310 if file:
310 file_path: PathLike[str] | str = os.path.join(self.temp_dir, file.filename) 311 file_path: PathLike[str] | str = os.path.join(self.temp_dir, file.filename)
311 await file.save(file_path) 312 await file.save(file_path)
312 await audio_playback.AudioPlaybackManager.play(ctx, file_path) 313 await get_voice_manager(self.bot).play(ctx, file_path)
313 else: 314 else:
314 try: 315 try:
315 if EXTERNAL_URL_PATTERN.match(melodia.lower()): 316 if EXTERNAL_URL_PATTERN.match(melodia.lower()):