mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 12:25:02 +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
|
@ -67,6 +67,7 @@ export const ForcebanCmd = modActionsCmd({
|
|||
pluginData.state.serverLogs.ignoreLog(LogType.MEMBER_BAN, user.id);
|
||||
|
||||
try {
|
||||
// FIXME: Use banUserId()?
|
||||
await pluginData.guild.banMember(user.id, 1, reason != null ? encodeURIComponent(reason) : undefined);
|
||||
} catch (e) {
|
||||
sendErrorMessage(pluginData, msg.channel, "Failed to forceban member");
|
||||
|
@ -93,5 +94,7 @@ export const ForcebanCmd = modActionsCmd({
|
|||
caseNumber: createdCase.case_number,
|
||||
reason,
|
||||
});
|
||||
|
||||
pluginData.state.events.emit("ban", user.id, reason);
|
||||
},
|
||||
});
|
||||
|
|
|
@ -75,6 +75,8 @@ export const MassbanCmd = modActionsCmd({
|
|||
reason: `Mass ban: ${banReason}`,
|
||||
postInCaseLogOverride: false,
|
||||
});
|
||||
|
||||
pluginData.state.events.emit("ban", userId, banReason);
|
||||
} catch (e) {
|
||||
failedBans.push(userId);
|
||||
}
|
||||
|
|
|
@ -49,5 +49,7 @@ export const NoteCmd = modActionsCmd({
|
|||
});
|
||||
|
||||
sendSuccessMessage(pluginData, msg.channel, `Note added on **${userName}** (Case #${createdCase.case_number})`);
|
||||
|
||||
pluginData.state.events.emit("note", user.id, reason);
|
||||
},
|
||||
});
|
||||
|
|
|
@ -112,5 +112,7 @@ export const WarnCmd = modActionsCmd({
|
|||
msg.channel,
|
||||
`Warned **${memberToWarn.user.username}#${memberToWarn.user.discriminator}** (Case #${warnResult.case.case_number})${messageResultText}`,
|
||||
);
|
||||
|
||||
pluginData.state.events.emit("warn", user.id, reason);
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue