我的代码:
@bot.command()
async def servers(ctx):
await ctx.send( f"I'm in {str(len(client.guilds))} servers")
当我使用命令时,它说:我在 0 个服务器中
,但它不在 0 个服务器中。
最佳答案
我试过你的代码。
此代码中没有错误,它按应有的方式运行。我试过这段代码:
使用 str()
@bot.command()
async def servers(ctx):
await ctx.send( f"I'm in {str(len(client.guilds))} servers")
用我们的 str()
@bot.command()
async def servers(ctx):
await ctx.send( f"I'm in {len(client.guilds)} servers")
我想先看看你的完整代码。
谢谢! :)
关于python - Discord.py 不显示它有多少台服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67055184/