Python 为什么发送消息不';不存在吗?

Python 为什么发送消息不';不存在吗?,python,python-3.x,discord,discord.py,Python,Python 3.x,Discord,Discord.py,discord.ext.commands.errors.CommandInvokeError:命令引发了错误 异常:AttributeError:“Bot”对象没有属性 “发送消息” 我有个问题,我真的不明白。这是我的密码: async def sad(ctx): await client.send_message(ctx.message.author, 'sad')``` AttributeError: 'Bot' object has no attribute 'send_mess

discord.ext.commands.errors.CommandInvokeError:命令引发了错误 异常:AttributeError:“Bot”对象没有属性 “发送消息”

我有个问题,我真的不明白。这是我的密码:

async def sad(ctx):
    await client.send_message(ctx.message.author, 'sad')```

AttributeError: 'Bot' object has no attribute 'send_message'

Discord.py最近迁移到“重写”:

# before
await client.send_message(channel, 'Hello')

# after
await channel.send('Hello')