首页 > 解决方案 > 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 语句)

标签: pythondiscord.pypython-asyncio

解决方案


推荐阅读