I tried to make it so that the bot will congratulate anyone who is promoted from Member to Respected (it doesn't automatically promote it; admins/owner does). However, for the following code, every time I promote someone from Member to Respected, it wouldn't detect the promotion.
@client.event
async def on_member_update(before, after):
if [i.id for i in before.roles].count(650019191092674569) == 1:
if [i.id for i in after.roles].count('658164877172408320') == 1:
channel = client.get_channel(649833392854007808)
print(f"""Recognized that {after.name} has been promoted from Member to Respected""")
await channel.send(f"""Congratulations {after.mention} for getting promoted to Respected!""")
I have also tried out this code, though the bot also didn't detect the promotion.
@client.event
async def on_member_update(before, after):
if before.roles.count(650019191092674569) == 1:
if after.roles.count('658164877172408320') == 1:
channel = client.get_channel(649833392854007808)
print(f"""Recognized that {after.name} has been promoted from Member to Respected""")
await channel.send(f"""Congratulations {after.mention} for getting promoted to Respected!""")
Please help? Thank you!