mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-15 06:05:03 +00:00
Add member_leave automod trigger
At least i think so - cant test it until knub changes are done
This commit is contained in:
parent
2700f4e389
commit
f9dd82f201
6 changed files with 49 additions and 2 deletions
|
@ -1,27 +0,0 @@
|
|||
import { typedGuildEventListener } from "knub";
|
||||
import { RecentActionType } from "../constants";
|
||||
import { runAutomod } from "../functions/runAutomod";
|
||||
import { AutomodContext, AutomodPluginType } from "../types";
|
||||
|
||||
export const RunAutomodOnJoinEvt = typedGuildEventListener<AutomodPluginType>()({
|
||||
event: "guildMemberAdd",
|
||||
listener({ pluginData, args: { member } }) {
|
||||
const context: AutomodContext = {
|
||||
timestamp: Date.now(),
|
||||
user: member.user,
|
||||
member,
|
||||
joined: true,
|
||||
};
|
||||
|
||||
pluginData.state.queue.add(() => {
|
||||
pluginData.state.recentActions.push({
|
||||
type: RecentActionType.MemberJoin,
|
||||
context,
|
||||
count: 1,
|
||||
identifier: null,
|
||||
});
|
||||
|
||||
runAutomod(pluginData, context);
|
||||
});
|
||||
},
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue