discord.py - A client event prevents my commands from working
问题描述
So I tried making a on_message event which detects a keyword and responds to it, but the problem is that now it doesn't let the other commands work?
async def on_message(message):
if 'gay' in message.content:
await message.channel.send('no u')
解决方案
您需要await client.process_commands(message)
在活动结束时添加on_message
。
推荐阅读
- arrays - 如何根据特定条件安排一个月的任务?
- json - 在 JSON IBM Watson Assistant 中计算年龄
- swift - 离开增强现实 ViewController 时,按钮在设备旋转之前不会检测到触摸
- python - python将日期转换为日期整数
- php - 图片上的链接在手机上不起作用
- excel - 如何解决 CATIA 宏中的运行时错误 438?
- java - 矩阵乘法 Big O 表示法
- c++ - 我的 Eclipse CDT 项目中有一个图像文件。如何在我的代码中引用它,以便协作者在运行代码时可以使用它?
- c - NULL 替代 C 语言 99 标准中的双精度数
- cmake - CMAKE - find_library find_path find_file 都不起作用