'@client.event() causing @bot.command()

When I first ran the code it worked, the bot responded to both commands and on_message events. But now I am confused as to what went wrong. I tried using

await bot.process_commands(message) 

but I received an attribute error: 'NoneType' object has no attribute 'id'

this is the code for the @bot.command

@bot.command()
async def wish(ctx, arg1, arg2):
    """
    !wish name age  
    """
   
    await ctx.send(f'HAPPY BIRTHDAY {arg1}! Have an awesome {arg2} birthday and I hope all your wishes come true!')

my @client.event is as follows:

@client.event 
async def on_message(message):
    if message.author == client.user:
        return 
    
    if any (word in message.content for word in intro_messages):
        await message.channel.send('Hello!')

I have two other events which I have not included which is a on_message_edit and on_reaction_add function.

I checked other responses to similar questions but none seemed to fit my code. Any advice is appreciated!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source