I am trying to send an error message with the error listener, though im getting
AttributeError: 'NoneType' object has no attribute 'channel_id'
async def on_error(error:Error):
x = error.ctx.channel_id #Error is here
with open('errors.txt', 'a') as f:
f.write(f"{error.source}\n{error.error}")
print(f"error.error: {error.error}\nerror.source: {error.source}\n")
embed = interactions.Embed(
title="Error",
description="Error",
color=BrandColors.RED
)
await (await bot.fetch_channel(x)).send(embed=embed)
I dont know why im getting a NoneType since I put the Error in the decorator