automod: add triggers for mod actions

This commit is contained in:
Dragory 2021-02-14 16:58:02 +02:00
parent 5ffc3e7cc4
commit 93912541b4
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
34 changed files with 412 additions and 3 deletions

View file

@ -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);
},
});