Call Cog.listener (#25)

This commit is contained in:
TSRBerry 2023-03-30 19:37:49 +02:00 committed by GitHub
parent 85595256c3
commit fc5b959558
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,7 +8,7 @@ class RolePersistence(Cog):
def __init__(self, bot): def __init__(self, bot):
self.bot = bot self.bot = bot
@Cog.listener @Cog.listener()
async def on_raw_member_remove(self, payload: RawMemberRemoveEvent): async def on_raw_member_remove(self, payload: RawMemberRemoveEvent):
save_roles = [] save_roles = []
for role in payload.user.roles: for role in payload.user.roles:
@ -20,7 +20,7 @@ class RolePersistence(Cog):
if len(save_roles) > 0: if len(save_roles) > 0:
add_user_roles(payload.user.id, save_roles) add_user_roles(payload.user.id, save_roles)
@Cog.listener @Cog.listener()
async def on_member_join(self, member: Member): async def on_member_join(self, member: Member):
user_roles = get_user_roles(member.id) user_roles = get_user_roles(member.id)
if len(user_roles) > 0: if len(user_roles) > 0: