The discord bot I made a year ago and deployed to Heroku has worked until now. However, after changing some cogs and updating python to version 3.9.10, I get the following warning in the Heroku logs:
app[worker.1]: /app/m_bot.py:120: RuntimeWarning: coroutine 'BotBase.load_extension' was never awaited
app[worker.1]: client.load_extension(f"cogs.{filename[:-3]}")
app[worker.1]: RuntimeWarning: Enable tracemalloc to get the object allocation traceback
app[worker.1]: Bot is ready.
app[api]: Build succeeded>
The 120 line block is:
for filename in os.listdir("./cogs"):
if filename.endswith(".py"):
# cut of the .py from the file name
client.load_extension(f"cogs.{filename[:-3]}")
The bot goes online but doesn't respond to any command. I haven't made any other changes apart from what was listed above.
It works when I run my bot on my PC, so I suspect it might be a version problem.
How can I resolve this?