-1

I am doing a rock paper scissors command and I'm trying to keep it basic. No reactions, it checks your arguments and then the bot tells you what it chose. Code:

@client.command(aliases=["rockpaperscissors"])
async def rps(ctx, args):
    await ctx.message.delete()
    if args == ("rock" or "paper" or "scissors" or "Rock" or "Paper" or "Scissors"):
        embed=discord.Embed(title='Rock paper scissors', description='You selected ' + args + f' - Bot selected {random.choice(rps)}.', color=RandomColor())
        await ctx.send(embed=embed)

    else:
        await ctx.send("Your option needs to be either rock, paper or scissors.")

So I was wondering what's wrong with my command. Is it the color?

khelwood
  • 52,115
  • 13
  • 74
  • 94

1 Answers1

1

The error is in the line:

if args == ("rock" or "paper" or "scissors" or "Rock" or "Paper" or "Scissors"):

The right operand is a boolean, so it'll never be equal to a string. It should be instead

if args in ("rock", "paper", "scissors", "Rock", "Paper", "Scissors"):

or even

if args.lower() in ("rock", "paper", "scissors"): 
enzo
  • 9,121
  • 2
  • 12
  • 36