简体   繁体   中英

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 . 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. Use bot.guilds instead.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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