on_presence_update - Called when a Member updates their presence.
there is a code:
@bot.event()
async def on_presence_update(self,before,after):
print('test')
And when the user's status is updated, the message "test" is sent 2 times. That is, it is called 2 times. Why? And how to fix it?
I’ll also add that this happens not only with this event.
Thank you for your help.
By using parentheses with
bot.event, you are not only listening for the event then calling the function, you are also calling the decorator. See Decorators With or Without Parentheses.Just like the example given in the documentation, you want to exclude the parentheses.