mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-18 15:45:03 +00:00
added new parameters
This commit is contained in:
parent
46515f0fb3
commit
5d56142b27
1 changed files with 105 additions and 104 deletions
|
@ -46,7 +46,7 @@ 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)]),
|
||||
role_restore_blacklist: t.union([t.boolean, t.array(t.string)]),
|
||||
restore_roles_on_mute: t.union([t.boolean, t.array(t.string)]),
|
||||
|
||||
can_view_list: t.boolean,
|
||||
can_cleanup: t.boolean,
|
||||
|
@ -106,7 +106,7 @@ export class MutesPlugin extends ZeppelinPlugin<TConfigSchema> {
|
|||
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,
|
||||
role_restore_blacklist: false,
|
||||
restore_roles_on_mute: false,
|
||||
|
||||
can_view_list: false,
|
||||
can_cleanup: false,
|
||||
|
@ -188,6 +188,10 @@ export class MutesPlugin extends ZeppelinPlugin<TConfigSchema> {
|
|||
await member.edit({ channelID: moveToVoiceChannelId });
|
||||
} catch (e) {} // tslint:disable-line
|
||||
}
|
||||
if (config.remove_roles_on_mute) {
|
||||
if (config.remove_roles_on_mute === true) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// If the user is already muted, update the duration of their existing mute
|
||||
|
@ -284,24 +288,21 @@ export class MutesPlugin extends ZeppelinPlugin<TConfigSchema> {
|
|||
mod: stripObjectToScalars(mod),
|
||||
user: stripObjectToScalars(user),
|
||||
time: timeUntilUnmute,
|
||||
reason,
|
||||
});
|
||||
} else {
|
||||
this.serverLogs.log(LogType.MEMBER_MUTE, {
|
||||
mod: stripObjectToScalars(mod),
|
||||
user: stripObjectToScalars(user),
|
||||
reason,
|
||||
});
|
||||
}
|
||||
|
||||
lock.unlock();
|
||||
|
||||
return {
|
||||
case: theCase,
|
||||
notifyResult,
|
||||
updatedExistingMute: !!existingMute,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public async unmuteUser(
|
||||
userId: string,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue