3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-11 04:45:02 +00:00

More Automod updates

This commit is contained in:
Dragory 2020-07-28 21:51:58 +03:00
parent e359fc46b2
commit 07da88b7cb
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
13 changed files with 88 additions and 28 deletions

View file

@ -1,9 +1,7 @@
import * as t from "io-ts";
import { automodAction } from "../helpers";
import { LogType } from "../../../data/LogType";
import { asyncMap, resolveMember, tNullable } from "../../../utils";
import { resolveActionContactMethods } from "../functions/resolveActionContactMethods";
import { ModActionsPlugin } from "../../ModActions/ModActionsPlugin";
import { LogsPlugin } from "../../Logs/LogsPlugin";
export const ChangeNicknameAction = automodAction({
configType: t.type({
@ -18,7 +16,9 @@ export const ChangeNicknameAction = automodAction({
if (pluginData.state.recentNicknameChanges.has(member.id)) continue;
member.edit({ nick: actionConfig.name }).catch(err => {
/* TODO: Log this error */
pluginData.getPlugin(LogsPlugin).log(LogType.BOT_ALERT, {
body: `Failed to change the nickname of \`${member.id}\``,
});
});
pluginData.state.recentNicknameChanges.set(member.id, { timestamp: Date.now() });