gpt4 book ai didi

python - Discord.py 不显示它有多少台服务器

转载 作者:行者123 更新时间:2023-12-05 06:47:34 25 4
gpt4 key购买 nike

我的代码:

@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")

下图显示了它是如何执行的: No Error!


我想先看看你的完整代码。

谢谢! :)

关于python - Discord.py 不显示它有多少台服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67055184/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com