我一直在尝试向一个公会的所有成员发送DM,但我总是得到这个错误。
AttributeError: 'ClientUser' object has no attribute 'create_dm'
这是我的代码
@bot.command()
async def send(ctx, *, message):
for member in ctx.guild.members:
channel = await member.create_dm()
channel.send(message)
await ctx.send('Messages successfully sent!')
我到底做错了什么?
我想明白了,我必须等待channel.send的到来。