所以我试图制作一个日志系统,但是我似乎无法获得更新的角色名称。我将如何去做?
async def on_member_update(self, before, after):
if before.nick != after.nick:
cc = self.bot.get_channel(497404990076485663)
ccc = discord.Embed(title=' ', description=f'{before.mention} **has changed their nickname from** `{before.nick}` **to** `{after.nick}`', color=0x00aad4)
ccc.timestamp = datetime.datetime.utcnow()
await cc.send(embed=ccc)
elif before.roles != after.roles:
cc = self.bot.get_channel(497404990076485663)
csc = discord.Embed(title=' ', description=f"**{before.mention}'s role has been changed. Role add/removed:** {after.roles.name}", color=0x00aad4)
csc.timestamp = datetime.datetime.utcnow()
await cc.send(embed=csc)