Python Can';我不能从我的discord bot向用户发送私人消息吗?

Python Can';我不能从我的discord bot向用户发送私人消息吗?,python,bots,discord,dm,Python,Bots,Discord,Dm,我想用discord bot向特定用户发送私人消息。我使用discord==1.0.1 discord.py==1.3.1。我已经试过使用文档()了,但我不明白。我尝试了以下代码,但不起作用: @client.command() async def cmds(ctx): embed = discord.Embed(title='Discord Server Befehle', description='Description',

我想用discord bot向特定用户发送私人消息。我使用discord==1.0.1 discord.py==1.3.1。我已经试过使用文档()了,但我不明白。我尝试了以下代码,但不起作用:

@client.command()
async def cmds(ctx):
    embed = discord.Embed(title='Discord Server Befehle',
                          description='Description',
                          color=0x374883)

    [...]

    msg = await ctx.send(embed=embed)
    await ctx.author.create_dm('Hi')
    print(f'{command_prefix}help ausgeführt von {ctx.author}')

尝试使用send函数而不是create_dm。create_dm只在两个用户之间创建通道,据我所知,discord会自动创建通道

根据文件

This should be rarely called, as this is done transparently for most people.
应该如此

ctx.author.send('Hi')