I'm new to coding in python, and I'm having trouble with this code.
@client.event
async def on_message(message):
if message.author == client.user:
return
if 'choose my pick' in message.content:
channel = message.channel
await channel.send('Que role tu ta?')
def check(m):
return m.content == 'top' or 'jg' or 'mid' or 'adc' or 'sup' and m.channel == channel
role = await client.wait_for('message', check=check)
sentence_start = random.choice(inu_exp)
iten = random.choice(itens)
if 'top' in role.content:
champion = random.choice(top_champs)
await channel.send(f'{sentence_start} {champion} de {iten}')
await client.process_commands(message)
It works as I want to, when someone type 'choose my pick' it asks 'Que role tu ta', but it asks many times, and it also sends the answer await channel.send(f'{sentence_start} {champion} de {iten}')
many times.
Here's the output: https://prnt.sc/y1cucv
I'm using python 3.8.6