Итак, я пытался заставить бота объявлять всякий раз, когда член получает роль, я знаю, что этот код может вообще не иметь смысла, но вот почему я спрашиваю: как я могу это сделать?
@bot.event
async def on_member_update(before, after):
if str(after.roles) == 'android':
fmt = "{0.mention} your role request has been accepted! :confetti_ball: You've been granted the role '{1}'"
await bot.send_message(bot.get_channel('495285593711050754'), fmt.format(member, after.roles.name))
print(colored('moderation.clf: ', 'blue'), colored('Android granted', 'white'))
if str(after.roles) == 'human':
fmt = "{0.mention} your role request has been accepted! :confetti_ball: You've been granted the role '{1}'"
await bot.send_message(bot.get_channel('495285593711050754'), fmt.format(member, after.roles.name))
print(colored('moderation.clf: ', 'blue'), colored('Human granted', 'white'))
if str(after.roles) == 'moderator':
fmt = "{0.mention} you are now part of the CyberLife staff, we're so excited to have you here! :confetti_ball:"
await bot.send_message(bot.get_channel('495285593711050754'), fmt.format(member, after.roles.name))
print(colored('moderation.clf: ', 'blue'), colored('Moderator granted', 'white'))