This commit is contained in:
Erik 2022-07-10 11:55:23 +03:00
parent defbe1b310
commit 649ed41e92
Signed by untrusted user: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB
2 changed files with 14 additions and 12 deletions

View File

@ -124,6 +124,8 @@ class ModerationManager {
});
}
console.log(responses);
const success = Boolean(responses.some((r) => !r.error));
const succeeded = responses.filter((r) => !r.error);
const failed = responses.filter((r) => r.error);
@ -138,8 +140,7 @@ class ModerationManager {
const fails = {};
for (const response of responses) {
const { type, target } = response.infraction;
if (!response.error) {
if (!silent) {
if (!response.error && !silent) {
if (successes[type]) {
successes[type].targets.push(target.tag || target.name);
} else {
@ -149,7 +150,6 @@ class ModerationManager {
escalation: response.escalation
};
}
}
} else {
if (fails[type]) {
fails[type].targets.push(target.tag || target.name);
@ -163,6 +163,7 @@ class ModerationManager {
}
}
console.log(successes);
const succeededTargets = succeeded.map((s) => s.infraction.target);
const actions = await this._handleArguments(invoker, succeededTargets, args); //eslint-disable-line no-unused-vars
@ -186,6 +187,7 @@ class ModerationManager {
data.escalation ? string += str : string = `${str}\n${string}`; //eslint-disable-line
}
}
console.log(string);
for (const [, data] of Object.entries(fails)) {
const { dictionary, targetType } = data.infraction;

View File

@ -26,7 +26,7 @@ class NoteCommand extends ModerationCommand {
return this.client.moderationManager.handleInfraction(Note, interaction, {
targets: users.value,
args: {
silent: silent || { value: true },
silent,
...args
}
});