O
O
Oh_noo21952021-10-22 17:40:53
Python
Oh_noo2195, 2021-10-22 17:40:53

I added bot.event and the commands stopped working, what should I do?

I added this part of the code, because of which all the commands stopped working
I would appreciate any help :>

@bot.event
async def on_message(message):
    if message.author == client.user:
        return
  
    pattern = re.compile(f"привет ") 

    if pattern.match(message.content.lower()) is not None:
        await message.channel.send(f"привет {message.author.mention}!")

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2021-10-22
@Oh_noo2195

The documentation has the answer. Repaired by adding on_message bot.process_commands(message)to the end
https://discordpy.readthedocs.io/en/latest/faq.htm...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question