我想从Discord.py重写版本的列表中的审核日志中获取所有昵称
答案 0 :(得分:0)
StackOverflow不是代码编写服务。我可以为您指明正确的方向。您必须编写自己的实际代码。
当您陷入困境时,请提出一个具体问题。
您需要遍历audit_logs
,请参阅:https://discordpy.readthedocs.io/en/latest/api.html?highlight=audit%20log#discord.Guild.audit_logs
要获取昵称更改的审核事件,您需要为action
过滤discord.AuditLogAction.member_update
,请参阅:https://discordpy.readthedocs.io/en/latest/api.html?highlight=audit%20log#discord.AuditLogAction.member_update
AuditLogEntry具有一个before
和after
,请参阅:https://discordpy.readthedocs.io/en/latest/api.html?highlight=audit%20log#discord.AuditLogEntry.before
这些是AuditLogDiff的实例,您可以访问其昵称,请参阅:https://discordpy.readthedocs.io/en/latest/api.html?highlight=audit%20log#discord.AuditLogDiff.nick