fix: manually load opus if not loaded already

This commit is contained in:
2025-01-06 16:11:27 -05:00
parent b9e5f1899e
commit eeca6ec5d9
2 changed files with 24 additions and 3 deletions

View File

@@ -438,9 +438,15 @@ def play_next(message, once=False, first=False):
message.guild.voice_client.stop()
if message.guild.id in players and players[message.guild.id].queue:
queued = players[message.guild.id].queue_pop()
message.guild.voice_client.play(
queued.player, after=lambda e: play_after_callback(e, message, once)
)
try:
message.guild.voice_client.play(
queued.player, after=lambda e: play_after_callback(e, message, once)
)
except disnake.opus.OpusNotLoaded:
utils.load_opus()
message.guild.voice_client.play(
queued.player, after=lambda e: play_after_callback(e, message, once)
)
client.loop.create_task(
utils.channel_send(message, queued.format(show_queuer=not first))
)