utils.py: Handle error embed creation in case of error in DMs.
@@ -61,5 +61,5 @@ def parse_time(time_string) -> int:
def create_error_embed(ctx, exc) -> discord.Embed:
embed = discord.Embed(title=f"Unexpected exception in command {ctx.command}", color=0x2F3136)
embed.add_field(name=f"{exc.__class__.__name__} Exception ", value=exc, inline=False)
- embed.add_field(name="Information", value=f"channel: {ctx.channel.mention}\ncommand: {ctx.command}\nmessage: {ctx.message.content}\nuser: {ctx.author.mention}", inline=False)
+ embed.add_field(name="Information", value=f"channel: {ctx.channel.mention if isinstance(ctx.channel, discord.TextChannel) else 'Direct Message'}\ncommand: {ctx.command}\nmessage: {ctx.message.content}\nuser: {ctx.author.mention}", inline=False)
return embed
