mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-06-08 00:05:01 +00:00
chore: format
This commit is contained in:
parent
6c55b98eee
commit
aaf4e02c5f
56 changed files with 282 additions and 255 deletions
|
@ -31,7 +31,7 @@ export const AddCaseMsgCmd = modActionsMsgCmd({
|
|||
return;
|
||||
}
|
||||
|
||||
const member = msg.member || await msg.guild.members.fetch(msg.author.id);
|
||||
const member = msg.member || (await msg.guild.members.fetch(msg.author.id));
|
||||
|
||||
// The moderator who did the action is the message author or, if used, the specified -mod
|
||||
let mod = member;
|
||||
|
|
|
@ -41,7 +41,7 @@ export const BanMsgCmd = modActionsMsgCmd({
|
|||
return;
|
||||
}
|
||||
|
||||
const member = msg.member || await msg.guild.members.fetch(msg.author.id);
|
||||
const member = msg.member || (await msg.guild.members.fetch(msg.author.id));
|
||||
|
||||
// The moderator who did the action is the message author or, if used, the specified -mod
|
||||
let mod = member;
|
||||
|
|
|
@ -41,7 +41,7 @@ export const CasesUserMsgCmd = modActionsMsgCmd({
|
|||
pluginData.state.common.sendErrorMessage(msg, `User not found`);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
const member = await resolveMessageMember(msg);
|
||||
|
||||
return actualCasesCmd(
|
||||
|
|
|
@ -48,12 +48,7 @@ export async function actualDeleteCaseCmd(
|
|||
content: "Delete the following case? Answer 'Yes' to continue, 'No' to cancel.",
|
||||
});
|
||||
|
||||
const reply = await helpers.waitForReply(
|
||||
pluginData.client,
|
||||
channel,
|
||||
author.id,
|
||||
15 * SECONDS,
|
||||
);
|
||||
const reply = await helpers.waitForReply(pluginData.client, channel, author.id, 15 * SECONDS);
|
||||
const normalizedReply = (reply?.content || "").toLowerCase().trim();
|
||||
if (normalizedReply !== "yes" && normalizedReply !== "y") {
|
||||
sendContextResponse(context, "Cancelled. Case was not deleted.");
|
||||
|
|
|
@ -39,7 +39,7 @@ export const ForceMuteMsgCmd = modActionsMsgCmd({
|
|||
return;
|
||||
}
|
||||
|
||||
const authorMember = await resolveMessageMember(msg)
|
||||
const authorMember = await resolveMessageMember(msg);
|
||||
const memberToMute = await resolveMember(pluginData.client, pluginData.guild, user.id);
|
||||
|
||||
// Make sure we're allowed to mute this user
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { hasPermission } from "knub/helpers";
|
||||
import { commandTypeHelpers as ct } from "../../../../commandTypes.js";
|
||||
import { resolveMessageMember } from "../../../../pluginUtils.js";
|
||||
import { resolveUser } from "../../../../utils.js";
|
||||
import { readContactMethodsFromArgs } from "../../functions/readContactMethodsFromArgs.js";
|
||||
import { modActionsMsgCmd } from "../../types.js";
|
||||
import { actualKickCmd } from "./actualKickCmd.js";
|
||||
import { resolveMessageMember } from "../../../../pluginUtils.js";
|
||||
|
||||
const opts = {
|
||||
mod: ct.member({ option: true }),
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { waitForReply } from "knub/helpers";
|
||||
import { commandTypeHelpers as ct } from "../../../../commandTypes.js";
|
||||
import { getContextChannel, resolveMessageMember, sendContextResponse } from "../../../../pluginUtils.js";
|
||||
import { resolveMessageMember } from "../../../../pluginUtils.js";
|
||||
import { modActionsMsgCmd } from "../../types.js";
|
||||
import { actualMassBanCmd } from "./actualMassBanCmd.js";
|
||||
|
||||
|
|
|
@ -3,7 +3,14 @@ import { GuildPluginData } from "knub";
|
|||
import { CaseTypes } from "../../../../data/CaseTypes.js";
|
||||
import { LogType } from "../../../../data/LogType.js";
|
||||
import { humanizeDurationShort } from "../../../../humanizeDuration.js";
|
||||
import { canActOn, deleteContextResponse, editContextResponse, getConfigForContext, getContextChannel, isContextInteraction, sendContextResponse } from "../../../../pluginUtils.js";
|
||||
import {
|
||||
canActOn,
|
||||
deleteContextResponse,
|
||||
editContextResponse,
|
||||
getConfigForContext,
|
||||
isContextInteraction,
|
||||
sendContextResponse,
|
||||
} from "../../../../pluginUtils.js";
|
||||
import { DAYS, MINUTES, SECONDS, noop } from "../../../../utils.js";
|
||||
import { CasesPlugin } from "../../../Cases/CasesPlugin.js";
|
||||
import { LogsPlugin } from "../../../Logs/LogsPlugin.js";
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { waitForReply } from "knub/helpers";
|
||||
import { commandTypeHelpers as ct } from "../../../../commandTypes.js";
|
||||
import { getContextChannel, resolveMessageMember, sendContextResponse } from "../../../../pluginUtils.js";
|
||||
import { resolveMessageMember } from "../../../../pluginUtils.js";
|
||||
import { modActionsMsgCmd } from "../../types.js";
|
||||
import { actualMassMuteCmd } from "./actualMassMuteCmd.js";
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ import { GuildPluginData } from "knub";
|
|||
import { LogType } from "../../../../data/LogType.js";
|
||||
import { logger } from "../../../../logger.js";
|
||||
import { canActOn, deleteContextResponse, isContextInteraction, sendContextResponse } from "../../../../pluginUtils.js";
|
||||
import { noop } from "../../../../utils.js";
|
||||
import { LogsPlugin } from "../../../Logs/LogsPlugin.js";
|
||||
import { MutesPlugin } from "../../../Mutes/MutesPlugin.js";
|
||||
import { handleAttachmentLinkDetectionAndGetRestriction } from "../../functions/attachmentLinkReaction.js";
|
||||
|
@ -11,7 +12,6 @@ import {
|
|||
formatReasonWithMessageLinkForAttachments,
|
||||
} from "../../functions/formatReasonForAttachments.js";
|
||||
import { ModActionsPluginType } from "../../types.js";
|
||||
import { noop } from "../../../../utils.js";
|
||||
|
||||
export async function actualMassMuteCmd(
|
||||
pluginData: GuildPluginData<ModActionsPluginType>,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { waitForReply } from "knub/helpers";
|
||||
import { commandTypeHelpers as ct } from "../../../../commandTypes.js";
|
||||
import { getContextChannel, resolveMessageMember, sendContextResponse } from "../../../../pluginUtils.js";
|
||||
import { resolveMessageMember } from "../../../../pluginUtils.js";
|
||||
import { modActionsMsgCmd } from "../../types.js";
|
||||
import { actualMassUnbanCmd } from "./actualMassUnbanCmd.js";
|
||||
|
||||
|
|
|
@ -30,16 +30,28 @@ export const zModActionsConfig = z.strictObject({
|
|||
message_on_ban: z.boolean().default(false),
|
||||
message_channel: z.nullable(z.string()).default(null),
|
||||
warn_message: z.nullable(z.string()).default("You have received a warning on the {guildName} server: {reason}"),
|
||||
kick_message: z.nullable(z.string()).default("You have been kicked from the {guildName} server. Reason given: {reason}"),
|
||||
ban_message: z.nullable(z.string()).default("You have been banned from the {guildName} server. Reason given: {reason}"),
|
||||
tempban_message: z.nullable(z.string()).default("You have been banned from the {guildName} server for {banTime}. Reason given: {reason}"),
|
||||
kick_message: z
|
||||
.nullable(z.string())
|
||||
.default("You have been kicked from the {guildName} server. Reason given: {reason}"),
|
||||
ban_message: z
|
||||
.nullable(z.string())
|
||||
.default("You have been banned from the {guildName} server. Reason given: {reason}"),
|
||||
tempban_message: z
|
||||
.nullable(z.string())
|
||||
.default("You have been banned from the {guildName} server for {banTime}. Reason given: {reason}"),
|
||||
alert_on_rejoin: z.boolean().default(false),
|
||||
alert_channel: z.nullable(z.string()).default(null),
|
||||
warn_notify_enabled: z.boolean().default(false),
|
||||
warn_notify_threshold: z.number().default(5),
|
||||
warn_notify_message: z.string().default("The user already has **{priorWarnings}** warnings!\n Please check their prior cases and assess whether or not to warn anyways.\n Proceed with the warning?"),
|
||||
warn_notify_message: z
|
||||
.string()
|
||||
.default(
|
||||
"The user already has **{priorWarnings}** warnings!\n Please check their prior cases and assess whether or not to warn anyways.\n Proceed with the warning?",
|
||||
),
|
||||
ban_delete_message_days: z.number().default(1),
|
||||
attachment_link_reaction: z.nullable(z.union([z.literal("none"), z.literal("warn"), z.literal("restrict")])).default("warn"),
|
||||
attachment_link_reaction: z
|
||||
.nullable(z.union([z.literal("none"), z.literal("warn"), z.literal("restrict")]))
|
||||
.default("warn"),
|
||||
can_note: z.boolean().default(false),
|
||||
can_warn: z.boolean().default(false),
|
||||
can_mute: z.boolean().default(false),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue