mercredi 5 août 2020

Why does my "else" display an invalid syntax? (discord.py)

I cant do an if else statement because no matter what i do, the else is always invalid syntax. This is a discord.py command for my bot. Im trying to make it so that when someone does /kill me it responds with "You [random outcome]" but when they do /kill [someone's name or tag] it responds with "[name or tag] [random outcome]". Here is the code:

options = ["me", "me pls", "me please", "me now"]

@client.command()
async def kill(ctx, *, question):
    if question: options = True
    client.remove_command('kill')
    outcomes = [' Survive!',
                ' Live!',
                ' Successfully Die!',
                ' ded',
                ' Got Killed!',
                '\'re Still Alive!',
                ' not ded',
                ' Died But Revived!',
                ' Entered a Coma!']
    await ctx.send(f'Pow!!:boom::gun: :cowboy: You{random.choice(outcomes)}')
    else: question: options = False
     outcomesmore = [' Survives!',
                     ' Lives!',
                     ' Successfully Dies!',
                     ' ded',
                     ' Got Killed!',
                     ' Is Still Alive!',
                     ' not ded',
                     ' Died But Revived!',
                     ' Entered a Coma!']
        await ctx.send(f'Pow!!:boom::gun: :cowboy: {question}{random.choice(outcomesmore)}')

Aucun commentaire:

Enregistrer un commentaire