aboutsummaryrefslogtreecommitdiffstats
path: root/cogs/music/play_commands.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-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 80a30ef..c6a55b0 100644
--- a/cogs/music/play_commands.py
+++ b/cogs/music/play_commands.py
@@ -17,10 +17,11 @@ import discord
17from discord.commands import OptionChoice 17from discord.commands import OptionChoice
18from discord.ext import commands 18from discord.ext import commands
19 19
20from cogs.music import audio_playback, media_processing 20from cogs.music import media_processing
21from cogs.utils.file_search import UniversalSearcher 21from cogs.utils.file_search import UniversalSearcher
22from cogs.utils.settings import get_uploadurl 22from cogs.utils.settings import get_uploadurl
23from cogs.utils.url_helper import clean_url_for_ytdlp 23from cogs.utils.url_helper import clean_url_for_ytdlp
24from cogs.voice import get_voice_manager
24 25
25logger = logging.getLogger(__name__) 26logger = logging.getLogger(__name__)
26 27
@@ -163,7 +164,7 @@ class PlayCommands(commands.Cog):
163 if not compressed_path: 164 if not compressed_path:
164 return 165 return
165 166
166 await audio_playback.AudioPlaybackManager.play( 167 await get_voice_manager(self.bot).play(
167 ctx, compressed_path, delete_after_play=True 168 ctx, compressed_path, delete_after_play=True
168 ) 169 )
169 except Exception as e: 170 except Exception as e:
@@ -210,7 +211,7 @@ class PlayCommands(commands.Cog):
210 211
211 upload_task = asyncio.create_task(self._upload_to_copyparty_async(local_path)) 212 upload_task = asyncio.create_task(self._upload_to_copyparty_async(local_path))
212 213
213 await audio_playback.AudioPlaybackManager.play( 214 await get_voice_manager(self.bot).play(
214 ctx, local_path, delete_after_play=True 215 ctx, local_path, delete_after_play=True
215 ) 216 )
216 217
@@ -266,7 +267,7 @@ class PlayCommands(commands.Cog):
266 if compressed: 267 if compressed:
267 await self._handle_compressed_file_play(ctx, url) 268 await self._handle_compressed_file_play(ctx, url)
268 else: 269 else:
269 await audio_playback.AudioPlaybackManager.play(ctx, url) 270 await get_voice_manager(self.bot).play(ctx, url)
270 271
271 @discord.slash_command(name="grajcuj", description="grajcujmy wszyscy!") 272 @discord.slash_command(name="grajcuj", description="grajcujmy wszyscy!")
272 async def play( 273 async def play(
@@ -301,7 +302,7 @@ class PlayCommands(commands.Cog):
301 if file: 302 if file:
302 file_path: PathLike[str] | str = os.path.join(self.temp_dir, file.filename) 303 file_path: PathLike[str] | str = os.path.join(self.temp_dir, file.filename)
303 await file.save(file_path) 304 await file.save(file_path)
304 await audio_playback.AudioPlaybackManager.play(ctx, file_path) 305 await get_voice_manager(self.bot).play(ctx, file_path)
305 else: 306 else:
306 try: 307 try:
307 if EXTERNAL_URL_PATTERN.match(melodia.lower()): 308 if EXTERNAL_URL_PATTERN.match(melodia.lower()):