Hi, I want to implement the usual logs in my bot, but so that the ID of the channel to which the message should be sent is taken from the database. I get an error in the event handler while trying to send a message to the channel I need. I have tried a lot - nothing helps, I will be grateful for the help. Screenshots of the code and errors attached.
#error: AttributeError: 'NoneType' object has no attribute 'send'
1 messages · Page 1 of 1 (latest)
Bot.get_channel may return None if the channel wasn't found in the bot's cache
and that happens because you probably don't have the guilds intent enabled, and thus the channels are not being cached
I have guild intents enabled, unfortunately this does not solve my problem
can you give the full traceback please?
okay so can you debug what's result1 before you get the channel?
solved
Solved the problem by replacing self.bot.get_channel() with await self.bot.fetch_channel()