python - 回复留言discord.py

标签 python discord

我想让我的机器人在用户输入某个句子时对用户消息使用react。
我的回复代码:

await ctx.message.reply("I just replied to you")
我收到错误:
ctx.message has no attribute "reply"
我可以做什么代码让机器人回复消息?
当我说回复时,我的意思与用户可以按消息回复相同

最佳答案

对于这里的任何新用户,截至 1.6.0 discord.py-rewrite 更新,你现在可以回复了!
discord.abc.Messageable现在有一个回复属性。要回复,只需使用

await ctx.reply('Hello!')
您也可以在回复中不提及作者 mention_author=False
await ctx.reply('Hello!', mention_author=False)
No reply example
Reply example
您还可以找到一个基本示例 Here

关于python - 回复留言discord.py,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65292230/

相关文章:

python - 如何创建 `numpy.array` 的 c 函数?

python - 更改 Seaborn 热图中缺失值的颜色

python - Pandas:将列表从列值映射到列?

python - 缓冲区 dtype 不匹配,预期为 'SIZE_t' 但得到 'long long'

python - 尝试创建一个 Discord webhook,在代码中分配了头像和用户名

python - 如何为列表中的每个项目多次调用 discord.py 函数?

python - Discord.py 尝试循环日志并发送到服务器时卡住

javascript - 发送图像而不显示不和谐库的链接

javascript - Discordjs bot (Nodejs) 如何使用reactjs将数据添加到DOM

python - 从特定索引加入列表