@bot.command()
async def strike(ctx, member : discord.Member):
count = 0
if (member.id == <id here>) and (count < 3):
count = count + 1
i am pretty new to python in general and have only used it to create a discord bot. When the strike command is run, it sets count = to 0 and therefore the count variable cannot go higher than 1. If I move the variable assignment outside of the command I get an error saying that the variable was referenced before it was assigned.
How can I change my code to add 1 to the variable every time the command is run without reassigning the variable every time the command is run?
I removed a lot of the code so the question is less cluttered, I believe this is the only issue preventing this command from working.