I'm trying to implement a command with discord.py that allows users to enter a queue. Once the queue hits 6 total users, it closes. Right now I'm just testing how to have the queue increment. Currently the queue returns back to the default count = 0, if count != 6. However, I'm not sure how to run the queue command again without it running through the entire function. Basically, once a user starts the queue command I need it to save their spot in the queue while also allowing more users to enter. All while avoiding returning to the beginning of the function.
I know it seems simple but I can't wrap my head around how to do it. I tried converting the members who queued into an integer to compare the total value of members queued with the 6 user limit, but can't parse "message.author" to integer.
@client.command()
async def queue(ctx):
count = 0
while count <= 6:
await ctx.send('Added to the queue!' f'{ctx.author.mention}')
count += 1
#member = ctx.author.mention
while count != 6:
return
else:
await ctx.send('Queue full')
Thanks for the help.