Cog-Creators / Red-DiscordBot

A multi-function Discord bot
https://docs.discord.red
GNU General Public License v3.0
4.72k stars 2.3k forks source link

[Audio] None on replace, in lavalink_event_handler #5049

Open PredaaA opened 3 years ago

PredaaA commented 3 years ago
[2021-05-17 16:58:06] [CRITICAL] red.main: Caught unhandled exception in task:
Traceback (most recent call last):
  File "/red/cogs/CogManager/cogs/audio/core/events/lavalink.py", line 286, in lavalink_event_handler
    description="{}\n{}".format(extra.replace("\n", ""), description),
AttributeError: 'NoneType' object has no attribute 'replace'
Drapersniper commented 2 years ago

This should already be fixed -

                    if event_type == lavalink.LavalinkEvents.TRACK_STUCK:
                        embed = discord.Embed(
                            colour=await self.bot.get_embed_color(message_channel),
                            title=_("Track Stuck"),
                            description=_(
                                "Playback of the song has stopped due to an unexpected error.\n{error}"
                            ).format(error=description),
                        )
                    else:
                        embed = discord.Embed(
                            title=_("Track Error"),
                            colour=await self.bot.get_embed_color(message_channel),
                            description="{}\n{}".format(
                                extra["message"].replace("\n", ""), description
                            ),
                        )

The current logic is this.