Add member_leave automod trigger

At least i think so - cant test it until knub changes are done
This commit is contained in:
Dark 2021-06-17 02:30:12 +02:00
parent 2700f4e389
commit f9dd82f201
No known key found for this signature in database
GPG key ID: 384C4B4F5B1E25A8
6 changed files with 49 additions and 2 deletions

View file

@ -25,3 +25,25 @@ export const RunAutomodOnJoinEvt = typedGuildEventListener<AutomodPluginType>()(
});
},
});
export const RunAutomodOnLeaveEvt = typedGuildEventListener<AutomodPluginType>()({
event: "guildMemberRemove",
listener({ pluginData, args: { member } }) {
const context: AutomodContext = {
timestamp: Date.now(),
partialMember: member,
joined: true,
};
pluginData.state.queue.add(() => {
pluginData.state.recentActions.push({
type: RecentActionType.MemberLeave,
context,
count: 1,
identifier: null,
});
runAutomod(pluginData, context);
});
},
});