mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-18 23:55:02 +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),
|
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)]),
|
||||||
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_view_list: t.boolean,
|
||||||
can_cleanup: 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}",
|
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,
|
||||||
role_restore_blacklist: false,
|
restore_roles_on_mute: false,
|
||||||
|
|
||||||
can_view_list: false,
|
can_view_list: false,
|
||||||
can_cleanup: false,
|
can_cleanup: false,
|
||||||
|
@ -188,6 +188,10 @@ export class MutesPlugin extends ZeppelinPlugin<TConfigSchema> {
|
||||||
await member.edit({ channelID: moveToVoiceChannelId });
|
await member.edit({ channelID: moveToVoiceChannelId });
|
||||||
} catch (e) {} // tslint:disable-line
|
} 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
|
// 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),
|
mod: stripObjectToScalars(mod),
|
||||||
user: stripObjectToScalars(user),
|
user: stripObjectToScalars(user),
|
||||||
time: timeUntilUnmute,
|
time: timeUntilUnmute,
|
||||||
reason,
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.serverLogs.log(LogType.MEMBER_MUTE, {
|
this.serverLogs.log(LogType.MEMBER_MUTE, {
|
||||||
mod: stripObjectToScalars(mod),
|
mod: stripObjectToScalars(mod),
|
||||||
user: stripObjectToScalars(user),
|
user: stripObjectToScalars(user),
|
||||||
reason,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
lock.unlock();
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
case: theCase,
|
case: theCase,
|
||||||
notifyResult,
|
notifyResult,
|
||||||
updatedExistingMute: !!existingMute,
|
updatedExistingMute: !!existingMute,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public async unmuteUser(
|
public async unmuteUser(
|
||||||
userId: string,
|
userId: string,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue