所以我一直试图让机器人在成员获得角色时宣布,我知道这段代码可能根本没有意义,但这就是我问的原因:我该怎么做?
@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'))
相关分类