3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-07-06 18:47:20 +00:00
This commit is contained in:
Shoaib Sajid 2024-01-11 09:45:15 +00:00 committed by GitHub
commit b19e841e39
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 9 additions and 9 deletions

View file

@ -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,

View file

@ -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,

View file

@ -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)) {

View file

@ -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,

View file

@ -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>;

View file

@ -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) {

View file

@ -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) {

View file

@ -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>