diff options
Diffstat (limited to 'cogs/music/play_compressed.py')
| -rw-r--r-- | cogs/music/play_compressed.py | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/cogs/music/play_compressed.py b/cogs/music/play_compressed.py index dd8dfd8..2bae269 100644 --- a/cogs/music/play_compressed.py +++ b/cogs/music/play_compressed.py | |||
| @@ -89,19 +89,10 @@ class GrajcujZkompresowane(commands.Cog): | |||
| 89 | found_file = compressed_file_path | 89 | found_file = compressed_file_path |
| 90 | found_title = title | 90 | found_title = title |
| 91 | title = found_title | 91 | title = found_title |
| 92 | def after_playing(error): | ||
| 93 | if error: | ||
| 94 | logger.error(f'Player error: {error}') | ||
| 95 | coro = vc.disconnect() | ||
| 96 | fut = asyncio.run_coroutine_threadsafe(coro, self.bot.loop) | ||
| 97 | try: | ||
| 98 | fut.result() | ||
| 99 | except Exception as e: | ||
| 100 | logger.error(f'Error disconnecting: {e}', exc_info=True) | ||
| 101 | 92 | ||
| 102 | if vc.is_playing() or vc.is_paused(): | 93 | if vc.is_playing() or vc.is_paused(): |
| 103 | vc.stop() | 94 | vc.stop() |
| 104 | vc.play(discord.FFmpegPCMAudio(found_file), after=after_playing) | 95 | vc.play(discord.FFmpegPCMAudio(found_file)) |
| 105 | await ctx.followup.send(f"gra (zkompresowane): {title}") | 96 | await ctx.followup.send(f"gra (zkompresowane): {title}") |
| 106 | logger.info(f"Playing audio: {title}") | 97 | logger.info(f"Playing audio: {title}") |
| 107 | 98 | ||
