【发布时间】:2021-02-09 14:32:59
【问题描述】:
我用 python 编写了一个不和谐的机器人,它一直工作到今天。今天它找不到我的服务器的成员,这显然是一个破坏者。为了确定故障点,我编写了以下测试例程:
@bot.command(name='test', help='test stuff')
async def test(ctx):
for guild in bot.guilds:
for member in guild.members:
print(member)
print("Test done")
这是我从文档中复制和粘贴的代码,它应该像往常一样工作。今天我得到了反馈:
Bot is ready. (=> this print command is generated on the startup of the bot)
Keeper of Keys#4019
Test done
Keeper of Keys 是机器人本身的名称。显然,机器人能够找到自己,但不能找到公会的其他成员。难道我做错了什么?提前致谢!
【问题讨论】:
标签: python discord discord.py