python - discord.py,我正在制作一个机器人响应,根据您的感受对您做出响应,但仅打印第一个 if 语句中的内容 - probl000000
问题描述
@commands.command(aliases=['im', 'i'])
async def userfeeling(self, ctx, *other):
if other or ctx == 'bad' or 'awful' or 'sad' or 'unhappy' or 'upset' or 'crying' or 'very
bad':
await ctx.send(random.choice(hru_bad_responce))
print("path1")
elif other or ctx == 'fine' or 'im fine':
await ctx.send('i detect lies')
print("path2")
elif other or ctx == 'good' or 'great' or 'amazing' or 'im okay' or 'okay' or 'happy':
await ctx.send(random.choice(hru_good_responce))
print("path3")
await ctx.send('{} arguments: {}'.format(len(other), ', '.join(other)))
它能做什么:
我:*我不高兴机器人(输出第一个 if 语句)
me: *im fine bot(输出第一个 if 语句)
me: *im good bot(输出第一个 if 语句)
它需要做什么:
我:*我不高兴机器人(输出第一个 if 语句)
我:*im fine bot(输出 2ndif 语句)
me: *im good bot(输出 3rdif 语句)
解决方案
推荐阅读
- javascript - 无法从下拉列表中获取用户输入
- haskell - 将浮点列表字符串转换为 Haskell 中的浮点列表列表
- elasticsearch - Elasticsearch:使用一个索引与多个索引时性能有何不同
- c++ - Visual Studio C++ 寻找不存在的 obj,link1104
- angularjs - AngularJS 和 WebAPI 中的 IdentityServer 角色/权限
- html - CSS / HTML中的字体不会改变?
- c# - OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError 在 WebElement 提交单击
- c++ - 将 opencv_world400.lib 和 opencv_world400d.lib 添加到依赖项中,仍然出现 LNK2001 错误
- azure - API 管理设置策略给出错误 id 为“servicefabric”的后端找不到
- apache-kafka - Kafka 生产者缓冲