python - 添加对 ctx.author 消息 discord.py 库的反应
问题描述
我想对 ctx.author 消息做出反应。我尝试了什么:
@client.command()
async def help:
command.add_reaction(':x:')
await ctx.author.send('Something')
但我得到那个命令没有 add_reaction
解决方案
替换command.add_reaction(':x:')
为await ctx.message.add_reaction('❌')
推荐阅读
- python - 将数据从 `tf.data.Dataset` 分发给多个工作人员(例如,对于 Horovod)
- kotlin - Kotlin - Random.nextInt 范围
- bash - 追加 groupID newusers
- r - 创建一个即使某些文件没有正确导入也能运行的函数
- c++ - Char在循环中读取数据时获取垃圾值
- python - 如何使用 python 在 discord.py 上制作排行榜命令?
- java - 如何从按钮中删除图像?
- php - 将 wordpress 过滤变成功能
- python - python unicode错误:为什么我使用了encode(utf-8)却一直得到这个字符?
- php - 在 HTML 表中对齐查询结果