Answer the question
In order to leave comments, you need to log in
'NoneType' object has no attribute 'send' What to do?
There is a code (error output to a specific chat):
@commands.Cog.listener()
async def on_command_error(self, ctx, exception):
embed = discord.Embed(title=':x: Command Error', colour=0xe74c3c) # Red
embed.add_field(name='Command', value=ctx.command)
embed.description = f"```py\n{traceback.format_exception(type(exception), exception, exception.__traceback__)}\n```"
embed.timestamp = datetime.datetime.utcnow()
channel = self.client.get_channel(727801516626542634)
await channel.send(embed=embed)
@commands.Cog.listener()
async def on_error(self, event):
embed = discord.Embed(title=':x: Event Error', colour=0xe74c3c) # Red
embed.add_field(name='Event', value=event)
embed.description = f"```py\n{traceback.format_exc()}\n```"
embed.timestamp = datetime.datetime.utcnow()
channel = self.client.get_channel(727801516626542634)
await channel.send(embed=embed)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question