Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/280.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python discord.py Bot未启动_Python_Discord.py - Fatal编程技术网

Python discord.py Bot未启动

Python discord.py Bot未启动,python,discord.py,Python,Discord.py,我有一个这样的入口点模块。这很好,而且很有效 “入口点” 导入操作系统 导入异步 从app.core导入BotClient#discord.ext.commands.Bot的子类` 异步def main(): 尝试: bot=BotClient() 等待bot.start(os.getenv(“bot\u令牌”)) 除键盘中断外: 等待bot.close() 如果名称=“\uuuuu main\uuuuuuuu”: 尝试: asyncio.run(main()) 除键盘中断外: 通过 但是,当

我有一个这样的入口点模块。这很好,而且很有效

“入口点”
导入操作系统
导入异步
从app.core导入BotClient#discord.ext.commands.Bot的子类`
异步def main():
尝试:
bot=BotClient()
等待bot.start(os.getenv(“bot\u令牌”))
除键盘中断外:
等待bot.close()
如果名称=“\uuuuu main\uuuuuuuu”:
尝试:
asyncio.run(main())
除键盘中断外:
通过
但是,当我将
bot
变量放入
中时,如果uuu name\uuuu==“\uuuu main\uuuu”:
,bot将不再启动。程序仍在运行并被阻止,但“准备就绪”功能未启动

“入口点”
导入操作系统
导入异步
从app.core导入BotClient#discord.ext.commands.Bot的子类`
异步def main():
尝试:
等待bot.start(os.getenv(“bot\u令牌”))
除键盘中断外:
等待bot.close()
如果名称=“\uuuuu main\uuuuuuuu”:
尝试:
bot=BotClient()
asyncio.run(main())
除键盘中断外:
通过

您是如何运行该模块的?通过像
python3.9run.py那样直接运行它。