mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-07-07 02:57:20 +00:00
Merge 53444e1f61
into c07e4321a7
This commit is contained in:
commit
b19e841e39
8 changed files with 9 additions and 9 deletions
|
@ -14,7 +14,7 @@ export const MuteAction = automodAction({
|
||||||
notify: tNullable(t.string),
|
notify: tNullable(t.string),
|
||||||
notifyChannel: tNullable(t.string),
|
notifyChannel: tNullable(t.string),
|
||||||
remove_roles_on_mute: tNullable(t.union([t.boolean, t.array(t.string)])),
|
remove_roles_on_mute: tNullable(t.union([t.boolean, t.array(t.string)])),
|
||||||
restore_roles_on_mute: tNullable(t.union([t.boolean, t.array(t.string)])),
|
restore_roles_on_unmute: tNullable(t.union([t.boolean, t.array(t.string)])),
|
||||||
postInCaseLog: tNullable(t.boolean),
|
postInCaseLog: tNullable(t.boolean),
|
||||||
hide_case: tNullable(t.boolean),
|
hide_case: tNullable(t.boolean),
|
||||||
}),
|
}),
|
||||||
|
@ -29,7 +29,7 @@ export const MuteAction = automodAction({
|
||||||
const reason = actionConfig.reason || "Muted automatically";
|
const reason = actionConfig.reason || "Muted automatically";
|
||||||
const contactMethods = actionConfig.notify ? resolveActionContactMethods(pluginData, actionConfig) : undefined;
|
const contactMethods = actionConfig.notify ? resolveActionContactMethods(pluginData, actionConfig) : undefined;
|
||||||
const rolesToRemove = actionConfig.remove_roles_on_mute;
|
const rolesToRemove = actionConfig.remove_roles_on_mute;
|
||||||
const rolesToRestore = actionConfig.restore_roles_on_mute;
|
const rolesToRestore = actionConfig.restore_roles_on_unmute;
|
||||||
|
|
||||||
const caseArgs: Partial<CaseArgs> = {
|
const caseArgs: Partial<CaseArgs> = {
|
||||||
modId: pluginData.client.user!.id,
|
modId: pluginData.client.user!.id,
|
||||||
|
|
|
@ -40,7 +40,7 @@ const defaultOptions = {
|
||||||
timed_mute_message: "You have been muted on the {guildName} server for {time}. Reason given: {reason}",
|
timed_mute_message: "You have been muted on the {guildName} server for {time}. Reason given: {reason}",
|
||||||
update_mute_message: "Your mute on the {guildName} server has been updated to {time}.",
|
update_mute_message: "Your mute on the {guildName} server has been updated to {time}.",
|
||||||
remove_roles_on_mute: false,
|
remove_roles_on_mute: false,
|
||||||
restore_roles_on_mute: false,
|
restore_roles_on_unmute: false,
|
||||||
|
|
||||||
can_view_list: false,
|
can_view_list: false,
|
||||||
can_cleanup: false,
|
can_cleanup: false,
|
||||||
|
|
|
@ -68,7 +68,7 @@ export async function muteUser(
|
||||||
const currentUserRoles = [...member.roles.cache.keys()];
|
const currentUserRoles = [...member.roles.cache.keys()];
|
||||||
let newRoles: string[] = currentUserRoles;
|
let newRoles: string[] = currentUserRoles;
|
||||||
const removeRoles = removeRolesOnMuteOverride ?? config.remove_roles_on_mute;
|
const removeRoles = removeRolesOnMuteOverride ?? config.remove_roles_on_mute;
|
||||||
const restoreRoles = restoreRolesOnMuteOverride ?? config.restore_roles_on_mute;
|
const restoreRoles = restoreRolesOnMuteOverride ?? config.restore_roles_on_unmute;
|
||||||
|
|
||||||
// Remove roles
|
// Remove roles
|
||||||
if (!Array.isArray(removeRoles)) {
|
if (!Array.isArray(removeRoles)) {
|
||||||
|
|
|
@ -25,7 +25,7 @@ export const ConfigSchema = t.type({
|
||||||
timed_mute_message: tNullable(t.string),
|
timed_mute_message: tNullable(t.string),
|
||||||
update_mute_message: tNullable(t.string),
|
update_mute_message: tNullable(t.string),
|
||||||
remove_roles_on_mute: t.union([t.boolean, t.array(t.string)]),
|
remove_roles_on_mute: t.union([t.boolean, t.array(t.string)]),
|
||||||
restore_roles_on_mute: t.union([t.boolean, t.array(t.string)]),
|
restore_roles_on_unmute: t.union([t.boolean, t.array(t.string)]),
|
||||||
|
|
||||||
can_view_list: t.boolean,
|
can_view_list: t.boolean,
|
||||||
can_cleanup: t.boolean,
|
can_cleanup: t.boolean,
|
||||||
|
|
|
@ -12,7 +12,7 @@ const BaseSingleSpamConfig = t.type({
|
||||||
mute: tNullable(t.boolean),
|
mute: tNullable(t.boolean),
|
||||||
mute_time: tNullable(t.number),
|
mute_time: tNullable(t.number),
|
||||||
remove_roles_on_mute: tNullable(t.union([t.boolean, t.array(t.string)])),
|
remove_roles_on_mute: tNullable(t.union([t.boolean, t.array(t.string)])),
|
||||||
restore_roles_on_mute: tNullable(t.union([t.boolean, t.array(t.string)])),
|
restore_roles_on_unmute: tNullable(t.union([t.boolean, t.array(t.string)])),
|
||||||
clean: tNullable(t.boolean),
|
clean: tNullable(t.boolean),
|
||||||
});
|
});
|
||||||
export type TBaseSingleSpamConfig = t.TypeOf<typeof BaseSingleSpamConfig>;
|
export type TBaseSingleSpamConfig = t.TypeOf<typeof BaseSingleSpamConfig>;
|
||||||
|
|
|
@ -87,7 +87,7 @@ export async function logAndDetectMessageSpam(
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
spamConfig.remove_roles_on_mute,
|
spamConfig.remove_roles_on_mute,
|
||||||
spamConfig.restore_roles_on_mute,
|
spamConfig.restore_roles_on_unmute,
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e instanceof RecoverablePluginError && e.code === ERRORS.NO_MUTE_ROLE_IN_CONFIG) {
|
if (e instanceof RecoverablePluginError && e.code === ERRORS.NO_MUTE_ROLE_IN_CONFIG) {
|
||||||
|
|
|
@ -51,7 +51,7 @@ export async function logAndDetectOtherSpam(
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
spamConfig.remove_roles_on_mute,
|
spamConfig.remove_roles_on_mute,
|
||||||
spamConfig.restore_roles_on_mute,
|
spamConfig.restore_roles_on_unmute,
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e instanceof RecoverablePluginError && e.code === ERRORS.NO_MUTE_ROLE_IN_CONFIG) {
|
if (e instanceof RecoverablePluginError && e.code === ERRORS.NO_MUTE_ROLE_IN_CONFIG) {
|
||||||
|
|
|
@ -136,7 +136,7 @@
|
||||||
mute:
|
mute:
|
||||||
reason: "You have been muted for tripping too many automod filters"
|
reason: "You have been muted for tripping too many automod filters"
|
||||||
remove_roles_on_mute: true
|
remove_roles_on_mute: true
|
||||||
restore_roles_on_mute: true
|
restore_roles_on_unmute: true
|
||||||
</CodeBlock>
|
</CodeBlock>
|
||||||
</template>
|
</template>
|
||||||
</Expandable>
|
</Expandable>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue