for filename in os.listdir("./cogs"):
if filename.endswith('.py'):
Bot.load_extension(f'cogs.{filename[:-3]}')
Bot.run(TOKEN)错误: main.py:259: RuntimeWarning: coroutine 'BotBase.load_extension‘从来没有等待过Bot.load_extension(f’‘cogs.{filename:-3}’) RuntimeWarning: Enable获取对象分配跟踪
发布于 2022-11-20 17:01:31
读错了。它说,您没有等待协同线,如果您查看您的代码,您确实没有等待它。
coroutine 'BotBase.load_extension‘从未被期待过
迁移指南解释了如何在2.0:https://discordpy.readthedocs.io/en/stable/migrating.html#extension-and-cog-loading-unloading-is-now-asynchronous中加载扩展
https://stackoverflow.com/questions/74510137
复制相似问题