3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-06-08 00:05:01 +00:00

Ran prettier to fix style issues

This commit is contained in:
Lily Bergonzat 2024-05-12 21:34:17 +02:00
parent 893a77d562
commit 1f0c7a4349
170 changed files with 396 additions and 453 deletions

View file

@ -1,8 +1,8 @@
import { waitForReply } from "knub/helpers";
import { commandTypeHelpers as ct } from "../../../../commandTypes";
import { getContextChannel, sendContextResponse } from "../../../../pluginUtils";
import { actualMassUnbanCmd } from "./actualMassUnbanCmd";
import { modActionsMsgCmd } from "../../types";
import { actualMassUnbanCmd } from "./actualMassUnbanCmd";
export const MassUnbanMsgCmd = modActionsMsgCmd({
trigger: "massunban",

View file

@ -1,9 +1,9 @@
import { GuildMember } from "discord.js";
import { slashOptions } from "knub";
import { generateAttachmentSlashOptions, retrieveMultipleOptions } from "../../../../utils/multipleSlashOptions";
import { actualMassUnbanCmd } from "./actualMassUnbanCmd";
import { modActionsSlashCmd } from "../../types";
import { NUMBER_ATTACHMENTS_CASE_CREATION } from "../constants";
import { actualMassUnbanCmd } from "./actualMassUnbanCmd";
const opts = [
slashOptions.string({ name: "reason", description: "The reason", required: false }),
@ -30,13 +30,7 @@ export const MassUnbanSlashCmd = modActionsSlashCmd({
const attachments = retrieveMultipleOptions(NUMBER_ATTACHMENTS_CASE_CREATION, options, "attachment");
if ((!options.reason || options.reason.trim() === "") && attachments.length < 1) {
pluginData.state.common.sendErrorMessage(
interaction,
"Text or attachment required",
undefined,
undefined,
true
);
pluginData.state.common.sendErrorMessage(interaction, "Text or attachment required", undefined, undefined, true);
return;
}

View file

@ -6,11 +6,11 @@ import { isContextInteraction, sendContextResponse } from "../../../../pluginUti
import { MINUTES, noop } from "../../../../utils";
import { CasesPlugin } from "../../../Cases/CasesPlugin";
import { LogsPlugin } from "../../../Logs/LogsPlugin";
import { IgnoredEventType, ModActionsPluginType } from "../../types";
import { handleAttachmentLinkDetectionAndGetRestriction } from "../../functions/attachmentLinkReaction";
import { formatReasonWithMessageLinkForAttachments } from "../../functions/formatReasonForAttachments";
import { ignoreEvent } from "../../functions/ignoreEvent";
import { isBanned } from "../../functions/isBanned";
import { IgnoredEventType, ModActionsPluginType } from "../../types";
export async function actualMassUnbanCmd(
pluginData: GuildPluginData<ModActionsPluginType>,
@ -75,10 +75,7 @@ export async function actualMassUnbanCmd(
const successfulUnbanCount = userIds.length - failedUnbans.length;
if (successfulUnbanCount === 0) {
// All unbans failed - don't create a log entry and notify the user
pluginData.state.common.sendErrorMessage(
context,
"All unbans failed. Make sure the IDs are valid and banned."
);
pluginData.state.common.sendErrorMessage(context, "All unbans failed. Make sure the IDs are valid and banned.");
} else {
// Some or all unbans were successful. Create a log entry for the mass unban and notify the user.
pluginData.getPlugin(LogsPlugin).logMassUnban({
@ -106,9 +103,9 @@ export async function actualMassUnbanCmd(
}
pluginData.state.common.sendSuccessMessage(
context,
`Unbanned ${successfulUnbanCount} users, ${failedUnbans.length} failed:\n${failedMsg}`,
);
context,
`Unbanned ${successfulUnbanCount} users, ${failedUnbans.length} failed:\n${failedMsg}`,
);
} else {
pluginData.state.common.sendSuccessMessage(context, `Unbanned ${successfulUnbanCount} users successfully`);
}