mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-11 20:55:01 +00:00
automod: add triggers for mod actions
This commit is contained in:
parent
5ffc3e7cc4
commit
93912541b4
34 changed files with 412 additions and 3 deletions
|
@ -127,6 +127,8 @@ export async function banUserId(
|
|||
banTime: banTime ? humanizeDuration(banTime) : null,
|
||||
});
|
||||
|
||||
pluginData.state.events.emit("ban", user.id, reason);
|
||||
|
||||
return {
|
||||
status: "success",
|
||||
case: createdCase,
|
||||
|
|
|
@ -85,6 +85,8 @@ export async function kickMember(
|
|||
reason,
|
||||
});
|
||||
|
||||
pluginData.state.events.emit("kick", member.id, reason);
|
||||
|
||||
return {
|
||||
status: "success",
|
||||
case: createdCase,
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import { ModActionsEvents, ModActionsPluginType } from "../types";
|
||||
|
||||
export function offModActionsEvent<TEvent extends keyof ModActionsEvents>(
|
||||
pluginData: GuildPluginData<ModActionsPluginType>,
|
||||
event: TEvent,
|
||||
listener: ModActionsEvents[TEvent],
|
||||
) {
|
||||
return pluginData.state.events.off(event, listener);
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import { ModActionsEvents, ModActionsPluginType } from "../types";
|
||||
|
||||
export function onModActionsEvent<TEvent extends keyof ModActionsEvents>(
|
||||
pluginData: GuildPluginData<ModActionsPluginType>,
|
||||
event: TEvent,
|
||||
listener: ModActionsEvents[TEvent],
|
||||
) {
|
||||
return pluginData.state.events.on(event, listener);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue