mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-07-06 18:47: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),
|
||||
notifyChannel: tNullable(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),
|
||||
hide_case: tNullable(t.boolean),
|
||||
}),
|
||||
|
@ -29,7 +29,7 @@ export const MuteAction = automodAction({
|
|||
const reason = actionConfig.reason || "Muted automatically";
|
||||
const contactMethods = actionConfig.notify ? resolveActionContactMethods(pluginData, actionConfig) : undefined;
|
||||
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> = {
|
||||
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}",
|
||||
update_mute_message: "Your mute on the {guildName} server has been updated to {time}.",
|
||||
remove_roles_on_mute: false,
|
||||
restore_roles_on_mute: false,
|
||||
restore_roles_on_unmute: false,
|
||||
|
||||
can_view_list: false,
|
||||
can_cleanup: false,
|
||||
|
|
|
@ -68,7 +68,7 @@ export async function muteUser(
|
|||
const currentUserRoles = [...member.roles.cache.keys()];
|
||||
let newRoles: string[] = currentUserRoles;
|
||||
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
|
||||
if (!Array.isArray(removeRoles)) {
|
||||
|
|
|
@ -25,7 +25,7 @@ export const ConfigSchema = t.type({
|
|||
timed_mute_message: tNullable(t.string),
|
||||
update_mute_message: tNullable(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_cleanup: t.boolean,
|
||||
|
|
|
@ -12,7 +12,7 @@ const BaseSingleSpamConfig = t.type({
|
|||
mute: tNullable(t.boolean),
|
||||
mute_time: tNullable(t.number),
|
||||
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),
|
||||
});
|
||||
export type TBaseSingleSpamConfig = t.TypeOf<typeof BaseSingleSpamConfig>;
|
||||
|
|
|
@ -87,7 +87,7 @@ export async function logAndDetectMessageSpam(
|
|||
},
|
||||
},
|
||||
spamConfig.remove_roles_on_mute,
|
||||
spamConfig.restore_roles_on_mute,
|
||||
spamConfig.restore_roles_on_unmute,
|
||||
);
|
||||
} catch (e) {
|
||||
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.restore_roles_on_mute,
|
||||
spamConfig.restore_roles_on_unmute,
|
||||
);
|
||||
} catch (e) {
|
||||
if (e instanceof RecoverablePluginError && e.code === ERRORS.NO_MUTE_ROLE_IN_CONFIG) {
|
||||
|
|
|
@ -136,7 +136,7 @@
|
|||
mute:
|
||||
reason: "You have been muted for tripping too many automod filters"
|
||||
remove_roles_on_mute: true
|
||||
restore_roles_on_mute: true
|
||||
restore_roles_on_unmute: true
|
||||
</CodeBlock>
|
||||
</template>
|
||||
</Expandable>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue