forked from Galactic/galactic-bot
fixes
This commit is contained in:
parent
defbe1b310
commit
649ed41e92
@ -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,17 +140,15 @@ class ModerationManager {
|
||||
const fails = {};
|
||||
for (const response of responses) {
|
||||
const { type, target } = response.infraction;
|
||||
if (!response.error) {
|
||||
if (!silent) {
|
||||
if (successes[type]) {
|
||||
successes[type].targets.push(target.tag || target.name);
|
||||
} else {
|
||||
successes[type] = {
|
||||
targets: [target.tag || target.name],
|
||||
infraction: response.infraction,
|
||||
escalation: response.escalation
|
||||
};
|
||||
}
|
||||
if (!response.error && !silent) {
|
||||
if (successes[type]) {
|
||||
successes[type].targets.push(target.tag || target.name);
|
||||
} else {
|
||||
successes[type] = {
|
||||
targets: [target.tag || target.name],
|
||||
infraction: response.infraction,
|
||||
escalation: response.escalation
|
||||
};
|
||||
}
|
||||
} else {
|
||||
if (fails[type]) {
|
||||
@ -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;
|
||||
|
@ -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
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user