mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 04:25:01 +00:00
15 lines
598 B
TypeScript
15 lines
598 B
TypeScript
import { AuditLogEvent } from "discord.js";
|
|
import { guildPluginEventListener } from "knub";
|
|
import { updateMemberCacheForMember } from "../functions/updateMemberCacheForMember";
|
|
import { GuildMemberCachePluginType } from "../types";
|
|
|
|
export const updateMemberCacheOnMemberUpdate = guildPluginEventListener<GuildMemberCachePluginType>()({
|
|
event: "guildAuditLogEntryCreate",
|
|
async listener({ pluginData, args: { auditLogEntry } }) {
|
|
if (auditLogEntry.action !== AuditLogEvent.MemberUpdate) {
|
|
return;
|
|
}
|
|
|
|
updateMemberCacheForMember(pluginData, auditLogEntry.targetId!);
|
|
},
|
|
});
|