mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 04:25:01 +00:00
feat: fixes to GuildMemberCache events
This commit is contained in:
parent
fa50110766
commit
baee6d2d45
3 changed files with 7 additions and 14 deletions
|
@ -1,15 +1,10 @@
|
|||
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!);
|
||||
event: "guildMemberUpdate",
|
||||
async listener({ pluginData, args: { newMember } }) {
|
||||
updateMemberCacheForMember(pluginData, newMember.id);
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue