简体   繁体   English

为什么我的状态码在 PyCharm (Python 3.8) 上不起作用

[英]Why isn't my status code working on PyCharm (Python 3.8)

I have this code which I tried making to have my bot status saying how many servers he is in. But there is an error and PyCharm says that bot doesn't have the attribute servers .我有这段代码,我试图让我的机器人状态说明他在多少台服务器中。但是有一个错误,PyCharm 说bot没有属性servers How do I fix it?我如何解决它?

await bot.change_presence(status=discord.Game(name="on " + str(len(bot.servers)) + " Servers.", type=0))

bot.servers does not exist. bot.servers不存在。 Use bot.guilds instead.改用bot.guilds

await bot.change_presence(status=discord.Game(name="on " + str(len(bot.guilds)) + " Servers.", type=0))```

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM