I wanted to clear the bot's chat history, so I deleted the general channel & made it again only to find that it couldn't find the general channel again.
I found the issue to be that guild systemChannel property was set to null, so now we're looping through all the channels until we're finding the one called 'general' & sending our messages there.
But also now, instead of sending all messages to the general channel, we check from which channel the message was sent from & attempt ot send it there instead, so if the bot is @mentioned in another channel, it responds there
I wanted to clear the bot's chat history, so I deleted the general channel & made it again only to find that it couldn't find the general channel again.
I found the issue to be that guild systemChannel property was set to null, so now we're looping through all the channels until we're finding the one called 'general' & sending our messages there.
But also now, instead of sending all messages to the general channel, we check from which channel the message was sent from & attempt ot send it there instead, so if the bot is @mentioned in another channel, it responds there