3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +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,12 +1,12 @@
import { PluginOptions, guildPlugin } from "knub";
import { GuildAutoReactions } from "../../data/GuildAutoReactions";
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
import { CommonPlugin } from "../Common/CommonPlugin";
import { LogsPlugin } from "../Logs/LogsPlugin";
import { DisableAutoReactionsCmd } from "./commands/DisableAutoReactionsCmd";
import { NewAutoReactionsCmd } from "./commands/NewAutoReactionsCmd";
import { AddReactionsEvt } from "./events/AddReactionsEvt";
import { AutoReactionsPluginType, zAutoReactionsConfig } from "./types";
import { CommonPlugin } from "../Common/CommonPlugin";
const defaultOptions: PluginOptions<AutoReactionsPluginType> = {
config: {
@ -54,5 +54,5 @@ export const AutoReactionsPlugin = guildPlugin<AutoReactionsPluginType>()({
beforeStart(pluginData) {
pluginData.state.common = pluginData.getPlugin(CommonPlugin);
}
},
});

View file

@ -1,5 +1,4 @@
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { CommonPlugin } from "../../Common/CommonPlugin";
import { autoReactionsCmd } from "../types";
export const DisableAutoReactionsCmd = autoReactionsCmd({

View file

@ -4,7 +4,6 @@ import { canUseEmoji, customEmojiRegex, isEmoji } from "../../../utils";
import { getMissingChannelPermissions } from "../../../utils/getMissingChannelPermissions";
import { missingPermissionError } from "../../../utils/missingPermissionError";
import { readChannelPermissions } from "../../../utils/readChannelPermissions";
import { CommonPlugin } from "../../Common/CommonPlugin";
import { autoReactionsCmd } from "../types";
const requiredPermissions = readChannelPermissions | PermissionsBitField.Flags.AddReactions;
@ -44,7 +43,10 @@ export const NewAutoReactionsCmd = autoReactionsCmd({
if (customEmojiMatch) {
// Custom emoji
if (!canUseEmoji(pluginData.client, customEmojiMatch[2])) {
pluginData.state.common.sendErrorMessage(msg, "I can only use regular emojis and custom emojis from this server");
pluginData.state.common.sendErrorMessage(
msg,
"I can only use regular emojis and custom emojis from this server",
);
return;
}

View file

@ -8,6 +8,7 @@ import { discardRegExpRunner, getRegExpRunner } from "../../regExpRunners";
import { MINUTES, SECONDS } from "../../utils";
import { registerEventListenersFromMap } from "../../utils/registerEventListenersFromMap";
import { unregisterEventListenersFromMap } from "../../utils/unregisterEventListenersFromMap";
import { CommonPlugin } from "../Common/CommonPlugin";
import { CountersPlugin } from "../Counters/CountersPlugin";
import { InternalPosterPlugin } from "../InternalPoster/InternalPosterPlugin";
import { LogsPlugin } from "../Logs/LogsPlugin";
@ -32,7 +33,6 @@ import { clearOldRecentNicknameChanges } from "./functions/clearOldNicknameChang
import { clearOldRecentActions } from "./functions/clearOldRecentActions";
import { clearOldRecentSpam } from "./functions/clearOldRecentSpam";
import { AutomodPluginType, zAutomodConfig } from "./types";
import { CommonPlugin } from "../Common/CommonPlugin";
const defaultOptions = {
config: {

View file

@ -9,6 +9,7 @@ import { GuildLogs } from "../../data/GuildLogs";
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
import { SavedMessage } from "../../data/entities/SavedMessage";
import { entries, zBoundedRecord, zDelayString } from "../../utils";
import { CommonPlugin } from "../Common/CommonPlugin";
import { CounterEvents } from "../Counters/types";
import { ModActionType, ModActionsEvents } from "../ModActions/types";
import { MutesEvents } from "../Mutes/types";
@ -17,7 +18,6 @@ import { RecentActionType } from "./constants";
import { availableTriggers } from "./triggers/availableTriggers";
import Timeout = NodeJS.Timeout;
import { CommonPlugin } from "../Common/CommonPlugin";
export type ZTriggersMapHelper = {
[TriggerName in keyof typeof availableTriggers]: (typeof availableTriggers)[TriggerName]["configSchema"];

View file

@ -2,7 +2,6 @@ import { ApiPermissions } from "@zeppelinbot/shared";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { isStaffPreFilter } from "../../../pluginUtils";
import { renderUsername } from "../../../utils";
import { CommonPlugin } from "../../Common/CommonPlugin";
import { botControlCmd } from "../types";
export const AddDashboardUserCmd = botControlCmd({

View file

@ -2,7 +2,6 @@ import { ApiPermissions } from "@zeppelinbot/shared";
import moment from "moment-timezone";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { DBDateFormat, isGuildInvite, resolveInvite } from "../../../utils";
import { CommonPlugin } from "../../Common/CommonPlugin";
import { isEligible } from "../functions/isEligible";
import { botControlCmd } from "../types";

View file

@ -3,7 +3,6 @@ import moment from "moment-timezone";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { isStaffPreFilter } from "../../../pluginUtils";
import { DBDateFormat, isSnowflake } from "../../../utils";
import { CommonPlugin } from "../../Common/CommonPlugin";
import { botControlCmd } from "../types";
export const AllowServerCmd = botControlCmd({

View file

@ -1,6 +1,5 @@
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { isStaffPreFilter } from "../../../pluginUtils";
import { CommonPlugin } from "../../Common/CommonPlugin";
import { botControlCmd } from "../types";
export const ChannelToServerCmd = botControlCmd({

View file

@ -2,7 +2,6 @@ import { Snowflake } from "discord.js";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { isStaffPreFilter } from "../../../pluginUtils";
import { noop } from "../../../utils";
import { CommonPlugin } from "../../Common/CommonPlugin";
import { botControlCmd } from "../types";
export const DisallowServerCmd = botControlCmd({

View file

@ -1,6 +1,5 @@
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { isGuildInvite, resolveInvite } from "../../../utils";
import { CommonPlugin } from "../../Common/CommonPlugin";
import { isEligible } from "../functions/isEligible";
import { botControlCmd } from "../types";

View file

@ -1,7 +1,6 @@
import { Snowflake } from "discord.js";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { isStaffPreFilter } from "../../../pluginUtils";
import { CommonPlugin } from "../../Common/CommonPlugin";
import { botControlCmd } from "../types";
export const LeaveServerCmd = botControlCmd({

View file

@ -2,7 +2,6 @@ import { commandTypeHelpers as ct } from "../../../commandTypes";
import { AllowedGuild } from "../../../data/entities/AllowedGuild";
import { ApiPermissionAssignment } from "../../../data/entities/ApiPermissionAssignment";
import { renderUsername, resolveUser } from "../../../utils";
import { CommonPlugin } from "../../Common/CommonPlugin";
import { botControlCmd } from "../types";
export const ListDashboardPermsCmd = botControlCmd({

View file

@ -1,6 +1,5 @@
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { renderUsername, resolveUser } from "../../../utils";
import { CommonPlugin } from "../../Common/CommonPlugin";
import { botControlCmd } from "../types";
export const ListDashboardUsersCmd = botControlCmd({

View file

@ -2,7 +2,6 @@ import moment from "moment-timezone";
import { GuildArchives } from "../../../data/GuildArchives";
import { getBaseUrl } from "../../../pluginUtils";
import { getRateLimitStats } from "../../../rateLimitStats";
import { CommonPlugin } from "../../Common/CommonPlugin";
import { botControlCmd } from "../types";
export const RateLimitPerformanceCmd = botControlCmd({

View file

@ -1,5 +1,4 @@
import { isStaffPreFilter } from "../../../pluginUtils";
import { CommonPlugin } from "../../Common/CommonPlugin";
import { getActiveReload, setActiveReload } from "../activeReload";
import { botControlCmd } from "../types";

View file

@ -1,7 +1,6 @@
import { Snowflake } from "discord.js";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { isStaffPreFilter } from "../../../pluginUtils";
import { CommonPlugin } from "../../Common/CommonPlugin";
import { botControlCmd } from "../types";
export const ReloadServerCmd = botControlCmd({

View file

@ -1,7 +1,6 @@
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { isStaffPreFilter } from "../../../pluginUtils";
import { renderUsername } from "../../../utils";
import { CommonPlugin } from "../../Common/CommonPlugin";
import { botControlCmd } from "../types";
export const RemoveDashboardUserCmd = botControlCmd({
@ -37,8 +36,6 @@ export const RemoveDashboardUserCmd = botControlCmd({
const userNameList = args.users.map((user) => `<@!${user.id}> (**${renderUsername(user)}**, \`${user.id}\`)`);
msg.channel.send(
`The following users were removed from the dashboard for **${guild.name}**:\n\n${userNameList}`,
);
msg.channel.send(`The following users were removed from the dashboard for **${guild.name}**:\n\n${userNameList}`);
},
});

View file

@ -1,4 +1,4 @@
import { BasePluginType, globalPluginEventListener, globalPluginMessageCommand, pluginUtils } from "knub";
import { BasePluginType, globalPluginEventListener, globalPluginMessageCommand } from "knub";
import z from "zod";
import { AllowedGuilds } from "../../data/AllowedGuilds";
import { ApiPermissionAssignments } from "../../data/ApiPermissionAssignments";

View file

@ -1,9 +1,9 @@
import { guildPlugin } from "knub";
import z from "zod";
import { CommonPlugin } from "../Common/CommonPlugin";
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
import { ArchiveChannelCmd } from "./commands/ArchiveChannelCmd";
import { ChannelArchiverPluginType } from "./types";
import { CommonPlugin } from "../Common/CommonPlugin";
export const ChannelArchiverPlugin = guildPlugin<ChannelArchiverPluginType>()({
name: "channel_archiver",
@ -18,5 +18,5 @@ export const ChannelArchiverPlugin = guildPlugin<ChannelArchiverPluginType>()({
beforeStart(pluginData) {
pluginData.state.common = pluginData.getPlugin(CommonPlugin);
}
},
});

View file

@ -3,7 +3,6 @@ import moment from "moment-timezone";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { isOwner } from "../../../pluginUtils";
import { SECONDS, confirm, noop, renderUsername } from "../../../utils";
import { CommonPlugin } from "../../Common/CommonPlugin";
import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin";
import { rehostAttachment } from "../rehostAttachment";
import { channelArchiverCmd } from "../types";

View file

@ -4,7 +4,7 @@ import { CommonPlugin } from "../Common/CommonPlugin";
export interface ChannelArchiverPluginType extends BasePluginType {
state: {
common: pluginUtils.PluginPublicInterface<typeof CommonPlugin>;
}
};
}
export const channelArchiverCmd = guildPluginMessageCommand<ChannelArchiverPluginType>();

View file

@ -139,7 +139,7 @@ export const CommonPlugin = guildPlugin<CommonPluginType>()({
if (!channel) {
throw new Error(
'Cannot store attachments: no attachment storing channel configured, and no backup channel passed'
"Cannot store attachments: no attachment storing channel configured, and no backup channel passed",
);
}
@ -148,6 +148,6 @@ export const CommonPlugin = guildPlugin<CommonPluginType>()({
files: attachments.map((a) => a.url),
});
},
}
};
},
});

View file

@ -9,11 +9,11 @@ import {
} from "discord.js";
import humanizeDuration from "humanize-duration";
import { GuildPluginData } from "knub";
import { canActOn } from "../../../pluginUtils";
import { ModActionsPlugin } from "../../ModActions/ModActionsPlugin";
import { logger } from "../../../logger";
import { canActOn } from "../../../pluginUtils";
import { convertDelayStringToMS, renderUserUsername } from "../../../utils";
import { CaseArgs } from "../../Cases/types";
import { ModActionsPlugin } from "../../ModActions/ModActionsPlugin";
import { MODAL_TIMEOUT } from "../commands/ModMenuUserCtxCmd";
import { ContextMenuPluginType, ModMenuActionType } from "../types";
import { updateAction } from "./update";

View file

@ -8,13 +8,13 @@ import {
TextInputStyle,
} from "discord.js";
import { GuildPluginData } from "knub";
import { canActOn } from "../../../pluginUtils";
import { ModActionsPlugin } from "../../ModActions/ModActionsPlugin";
import { CaseTypes } from "../../../data/CaseTypes";
import { logger } from "../../../logger";
import { canActOn } from "../../../pluginUtils";
import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin";
import { renderUserUsername } from "../../../utils";
import { LogsPlugin } from "../../Logs/LogsPlugin";
import { ModActionsPlugin } from "../../ModActions/ModActionsPlugin";
import { MODAL_TIMEOUT } from "../commands/ModMenuUserCtxCmd";
import { ContextMenuPluginType, ModMenuActionType } from "../types";

View file

@ -8,11 +8,11 @@ import {
TextInputStyle,
} from "discord.js";
import { GuildPluginData } from "knub";
import { canActOn } from "../../../pluginUtils";
import { ModActionsPlugin } from "../../ModActions/ModActionsPlugin";
import { logger } from "../../../logger";
import { canActOn } from "../../../pluginUtils";
import { renderUserUsername } from "../../../utils";
import { CaseArgs } from "../../Cases/types";
import { ModActionsPlugin } from "../../ModActions/ModActionsPlugin";
import { MODAL_TIMEOUT } from "../commands/ModMenuUserCtxCmd";
import { ContextMenuPluginType, ModMenuActionType } from "../types";
import { updateAction } from "./update";

View file

@ -12,13 +12,12 @@ import {
import { GuildPluginData, guildPluginUserContextMenuCommand } from "knub";
import { Case } from "../../../data/entities/Case";
import { logger } from "../../../logger";
import { ModActionsPlugin } from "../../ModActions/ModActionsPlugin";
import { SECONDS, UnknownUser, emptyEmbedValue, renderUserUsername, resolveUser, trimLines } from "../../../utils";
import { asyncMap } from "../../../utils/async";
import { getChunkedEmbedFields } from "../../../utils/getChunkedEmbedFields";
import { getGuildPrefix } from "../../../utils/getGuildPrefix";
import { CasesPlugin } from "../../Cases/CasesPlugin";
import { UtilityPlugin } from "../../Utility/UtilityPlugin";
import { ModActionsPlugin } from "../../ModActions/ModActionsPlugin";
import { getUserInfoEmbed } from "../../Utility/functions/getUserInfoEmbed";
import { launchBanActionModal } from "../actions/ban";
import { launchMuteActionModal } from "../actions/mute";

View file

@ -4,6 +4,7 @@ import { GuildCounters } from "../../data/GuildCounters";
import { CounterTrigger, parseCounterConditionString } from "../../data/entities/CounterTrigger";
import { makePublicFn } from "../../pluginUtils";
import { MINUTES, convertDelayStringToMS, values } from "../../utils";
import { CommonPlugin } from "../Common/CommonPlugin";
import { AddCounterCmd } from "./commands/AddCounterCmd";
import { CountersListCmd } from "./commands/CountersListCmd";
import { ResetAllCounterValuesCmd } from "./commands/ResetAllCounterValuesCmd";
@ -19,7 +20,6 @@ import { offCounterEvent } from "./functions/offCounterEvent";
import { onCounterEvent } from "./functions/onCounterEvent";
import { setCounterValue } from "./functions/setCounterValue";
import { CountersPluginType, zCountersConfig } from "./types";
import { CommonPlugin } from "../Common/CommonPlugin";
const DECAY_APPLY_INTERVAL = 5 * MINUTES;

View file

@ -3,7 +3,6 @@ import { guildPluginMessageCommand } from "knub";
import { waitForReply } from "knub/helpers";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { UnknownUser, resolveUser } from "../../../utils";
import { CommonPlugin } from "../../Common/CommonPlugin";
import { changeCounterValue } from "../functions/changeCounterValue";
import { CountersPluginType } from "../types";

View file

@ -1,7 +1,6 @@
import { guildPluginMessageCommand } from "knub";
import { trimMultilineString, ucfirst } from "../../../utils";
import { getGuildPrefix } from "../../../utils/getGuildPrefix";
import { CommonPlugin } from "../../Common/CommonPlugin";
import { CountersPluginType } from "../types";
export const CountersListCmd = guildPluginMessageCommand<CountersPluginType>()({

View file

@ -1,7 +1,6 @@
import { guildPluginMessageCommand } from "knub";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { confirm, noop, trimMultilineString } from "../../../utils";
import { CommonPlugin } from "../../Common/CommonPlugin";
import { resetAllCounterValues } from "../functions/resetAllCounterValues";
import { CountersPluginType } from "../types";
@ -23,7 +22,10 @@ export const ResetAllCounterValuesCmd = guildPluginMessageCommand<CountersPlugin
}
if (counter.can_reset_all === false) {
void pluginData.state.common.sendErrorMessage(message, `Missing permissions to reset all of this counter's values`);
void pluginData.state.common.sendErrorMessage(
message,
`Missing permissions to reset all of this counter's values`,
);
return;
}
@ -47,7 +49,10 @@ export const ResetAllCounterValuesCmd = guildPluginMessageCommand<CountersPlugin
await resetAllCounterValues(pluginData, args.counterName);
loadingMessage?.delete().catch(noop);
void pluginData.state.common.sendSuccessMessage(message, `All counter values for **${counterName}** have been reset`);
void pluginData.state.common.sendSuccessMessage(
message,
`All counter values for **${counterName}** have been reset`,
);
pluginData.getKnubInstance().reloadGuild(pluginData.guild.id);
},

View file

@ -3,7 +3,6 @@ import { guildPluginMessageCommand } from "knub";
import { waitForReply } from "knub/helpers";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { UnknownUser, resolveUser } from "../../../utils";
import { CommonPlugin } from "../../Common/CommonPlugin";
import { setCounterValue } from "../functions/setCounterValue";
import { CountersPluginType } from "../types";

View file

@ -3,7 +3,6 @@ import { guildPluginMessageCommand } from "knub";
import { waitForReply } from "knub/helpers";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { UnknownUser, resolveUser } from "../../../utils";
import { CommonPlugin } from "../../Common/CommonPlugin";
import { setCounterValue } from "../functions/setCounterValue";
import { CountersPluginType } from "../types";

View file

@ -3,7 +3,6 @@ import { guildPluginMessageCommand } from "knub";
import { waitForReply } from "knub/helpers";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { resolveUser, UnknownUser } from "../../../utils";
import { CommonPlugin } from "../../Common/CommonPlugin";
import { CountersPluginType } from "../types";
export const ViewCounterCmd = guildPluginMessageCommand<CountersPluginType>()({

View file

@ -9,8 +9,8 @@ import {
parseCounterConditionString,
} from "../../data/entities/CounterTrigger";
import { zBoundedCharacters, zBoundedRecord, zDelayString } from "../../utils";
import Timeout = NodeJS.Timeout;
import { CommonPlugin } from "../Common/CommonPlugin";
import Timeout = NodeJS.Timeout;
const MAX_COUNTERS = 5;
const MAX_TRIGGERS_PER_COUNTER = 5;

View file

@ -11,10 +11,10 @@ import {
messageToTemplateSafeMessage,
userToTemplateSafeUser,
} from "../../utils/templateSafeObjects";
import { CommonPlugin } from "../Common/CommonPlugin";
import { LogsPlugin } from "../Logs/LogsPlugin";
import { runEvent } from "./functions/runEvent";
import { CustomEventsPluginType, zCustomEventsConfig } from "./types";
import { CommonPlugin } from "../Common/CommonPlugin";
const defaultOptions = {
config: {

View file

@ -1,7 +1,6 @@
import { Message } from "discord.js";
import { GuildPluginData } from "knub";
import { TemplateSafeValueContainer } from "../../../templateFormatter";
import { CommonPlugin } from "../../Common/CommonPlugin";
import { ActionError } from "../ActionError";
import { addRoleAction } from "../actions/addRoleAction";
import { createCaseAction } from "../actions/createCaseAction";

View file

@ -1,6 +1,7 @@
import { BasePluginType, pluginUtils } from "knub";
import z from "zod";
import { zBoundedCharacters, zBoundedRecord } from "../../utils";
import { CommonPlugin } from "../Common/CommonPlugin";
import { zAddRoleAction } from "./actions/addRoleAction";
import { zCreateCaseAction } from "./actions/createCaseAction";
import { zMakeRoleMentionableAction } from "./actions/makeRoleMentionableAction";
@ -8,7 +9,6 @@ import { zMakeRoleUnmentionableAction } from "./actions/makeRoleUnmentionableAct
import { zMessageAction } from "./actions/messageAction";
import { zMoveToVoiceChannelAction } from "./actions/moveToVoiceChannelAction";
import { zSetChannelPermissionOverridesAction } from "./actions/setChannelPermissionOverrides";
import { CommonPlugin } from "../Common/CommonPlugin";
const zCommandTrigger = z.strictObject({
type: z.literal("command"),

View file

@ -1,6 +1,7 @@
import { PluginOptions, guildPlugin } from "knub";
import { onGuildEvent } from "../../data/GuildEvents";
import { GuildVCAlerts } from "../../data/GuildVCAlerts";
import { CommonPlugin } from "../Common/CommonPlugin";
import { FollowCmd } from "./commands/FollowCmd";
import { DeleteFollowCmd, ListFollowCmd } from "./commands/ListFollowCmd";
import { WhereCmd } from "./commands/WhereCmd";
@ -9,7 +10,6 @@ import { VoiceStateUpdateAlertEvt } from "./events/SendAlertsEvts";
import { LocateUserPluginType, zLocateUserConfig } from "./types";
import { clearExpiredAlert } from "./utils/clearExpiredAlert";
import { fillActiveAlertsList } from "./utils/fillAlertsList";
import { CommonPlugin } from "../Common/CommonPlugin";
const defaultOptions: PluginOptions<LocateUserPluginType> = {
config: {

View file

@ -3,7 +3,6 @@ import moment from "moment-timezone";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { registerExpiringVCAlert } from "../../../data/loops/expiringVCAlertsLoop";
import { MINUTES, SECONDS } from "../../../utils";
import { CommonPlugin } from "../../Common/CommonPlugin";
import { locateUserCmd } from "../types";
export const FollowCmd = locateUserCmd({
@ -55,9 +54,7 @@ export const FollowCmd = locateUserCmd({
} else {
void pluginData.state.common.sendSuccessMessage(
msg,
`Every time <@${args.member.id}> joins or switches VC in the next ${humanizeDuration(
time,
)} i will notify you`,
`Every time <@${args.member.id}> joins or switches VC in the next ${humanizeDuration(time)} i will notify you`,
);
}
},

View file

@ -1,7 +1,6 @@
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { clearExpiringVCAlert } from "../../../data/loops/expiringVCAlertsLoop";
import { createChunkedMessage, sorter } from "../../../utils";
import { CommonPlugin } from "../../Common/CommonPlugin";
import { locateUserCmd } from "../types";
export const ListFollowCmd = locateUserCmd({

View file

@ -1,6 +1,5 @@
import { GuildMember, GuildTextBasedChannel, Snowflake } from "discord.js";
import { GuildPluginData } from "knub";
import { CommonPlugin } from "../../Common/CommonPlugin";
import { LocateUserPluginType } from "../types";
export async function moveMember(

View file

@ -1,7 +1,6 @@
import { GuildMember, GuildTextBasedChannel, Invite, VoiceChannel } from "discord.js";
import { GuildPluginData } from "knub";
import { getInviteLink } from "knub/helpers";
import { CommonPlugin } from "../../Common/CommonPlugin";
import { LocateUserPluginType } from "../types";
import { createOrReuseInvite } from "./createOrReuseInvite";

View file

@ -1,10 +1,10 @@
import { PluginOptions, guildPlugin } from "knub";
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
import { CommonPlugin } from "../Common/CommonPlugin";
import { SaveMessagesToDBCmd } from "./commands/SaveMessagesToDB";
import { SavePinsToDBCmd } from "./commands/SavePinsToDB";
import { MessageCreateEvt, MessageDeleteBulkEvt, MessageDeleteEvt, MessageUpdateEvt } from "./events/SaveMessagesEvts";
import { MessageSaverPluginType, zMessageSaverConfig } from "./types";
import { CommonPlugin } from "../Common/CommonPlugin";
const defaultOptions: PluginOptions<MessageSaverPluginType> = {
config: {

View file

@ -1,5 +1,4 @@
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { CommonPlugin } from "../../Common/CommonPlugin";
import { saveMessagesToDB } from "../saveMessagesToDB";
import { messageSaverCmd } from "../types";

View file

@ -1,5 +1,4 @@
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { CommonPlugin } from "../../Common/CommonPlugin";
import { saveMessagesToDB } from "../saveMessagesToDB";
import { messageSaverCmd } from "../types";

View file

@ -10,6 +10,7 @@ import { GuildTempbans } from "../../data/GuildTempbans";
import { makePublicFn, mapToPublicFn } from "../../pluginUtils";
import { MINUTES } from "../../utils";
import { CasesPlugin } from "../Cases/CasesPlugin";
import { CommonPlugin } from "../Common/CommonPlugin";
import { LogsPlugin } from "../Logs/LogsPlugin";
import { MutesPlugin } from "../Mutes/MutesPlugin";
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
@ -72,7 +73,6 @@ import { onModActionsEvent } from "./functions/onModActionsEvent";
import { updateCase } from "./functions/updateCase";
import { warnMember } from "./functions/warnMember";
import { AttachmentLinkReactionType, ModActionsPluginType, modActionsSlashGroup, zModActionsConfig } from "./types";
import { CommonPlugin } from "../Common/CommonPlugin";
const defaultOptions = {
config: {

View file

@ -2,8 +2,8 @@ import { commandTypeHelpers as ct } from "../../../../commandTypes";
import { CaseTypes } from "../../../../data/CaseTypes";
import { hasPermission } from "../../../../pluginUtils";
import { resolveUser } from "../../../../utils";
import { actualAddCaseCmd } from "./actualAddCaseCmd";
import { modActionsMsgCmd } from "../../types";
import { actualAddCaseCmd } from "./actualAddCaseCmd";
const opts = {
mod: ct.member({ option: true }),

View file

@ -4,9 +4,9 @@ import { CaseTypes } from "../../../../data/CaseTypes";
import { hasPermission } from "../../../../pluginUtils";
import { resolveMember } from "../../../../utils";
import { generateAttachmentSlashOptions, retrieveMultipleOptions } from "../../../../utils/multipleSlashOptions";
import { actualAddCaseCmd } from "./actualAddCaseCmd";
import { modActionsSlashCmd } from "../../types";
import { NUMBER_ATTACHMENTS_CASE_CREATION } from "../constants";
import { actualAddCaseCmd } from "./actualAddCaseCmd";
const opts = [
slashOptions.string({ name: "reason", description: "The reason", required: false }),
@ -48,10 +48,7 @@ export const AddCaseSlashCmd = modActionsSlashCmd({
if (options.mod) {
if (!canActAsOther) {
pluginData.state.common.sendErrorMessage(
interaction,
"You don't have permission to act as another moderator"
);
pluginData.state.common.sendErrorMessage(interaction, "You don't have permission to act as another moderator");
return;
}

View file

@ -6,9 +6,9 @@ import { canActOn } from "../../../../pluginUtils";
import { UnknownUser, renderUsername, resolveMember } from "../../../../utils";
import { CasesPlugin } from "../../../Cases/CasesPlugin";
import { LogsPlugin } from "../../../Logs/LogsPlugin";
import { ModActionsPluginType } from "../../types";
import { handleAttachmentLinkDetectionAndGetRestriction } from "../../functions/attachmentLinkReaction";
import { formatReasonWithMessageLinkForAttachments } from "../../functions/formatReasonForAttachments";
import { ModActionsPluginType } from "../../types";
export async function actualAddCaseCmd(
pluginData: GuildPluginData<ModActionsPluginType>,
@ -27,10 +27,7 @@ export async function actualAddCaseCmd(
// If the user exists as a guild member, make sure we can act on them first
const member = await resolveMember(pluginData.client, pluginData.guild, user.id);
if (member && !canActOn(pluginData, author, member)) {
pluginData.state.common.sendErrorMessage(
context,
"Cannot add case on this user: insufficient permissions"
);
pluginData.state.common.sendErrorMessage(context, "Cannot add case on this user: insufficient permissions");
return;
}
@ -49,7 +46,7 @@ export async function actualAddCaseCmd(
if (user) {
pluginData.state.common.sendSuccessMessage(
context,
`Case #${theCase.case_number} created for **${renderUsername(user)}**`
`Case #${theCase.case_number} created for **${renderUsername(user)}**`,
);
} else {
pluginData.state.common.sendSuccessMessage(context, `Case #${theCase.case_number} created`);

View file

@ -1,9 +1,9 @@
import { commandTypeHelpers as ct } from "../../../../commandTypes";
import { hasPermission } from "../../../../pluginUtils";
import { UserNotificationMethod, resolveUser } from "../../../../utils";
import { actualBanCmd } from "./actualBanCmd";
import { readContactMethodsFromArgs } from "../../functions/readContactMethodsFromArgs";
import { modActionsMsgCmd } from "../../types";
import { actualBanCmd } from "./actualBanCmd";
const opts = {
mod: ct.member({ option: true }),

View file

@ -3,10 +3,10 @@ import { slashOptions } from "knub";
import { hasPermission } from "../../../../pluginUtils";
import { UserNotificationMethod, convertDelayStringToMS, resolveMember } from "../../../../utils";
import { generateAttachmentSlashOptions, retrieveMultipleOptions } from "../../../../utils/multipleSlashOptions";
import { actualBanCmd } from "./actualBanCmd";
import { readContactMethodsFromArgs } from "../../functions/readContactMethodsFromArgs";
import { modActionsSlashCmd } from "../../types";
import { NUMBER_ATTACHMENTS_CASE_CREATION } from "../constants";
import { actualBanCmd } from "./actualBanCmd";
const opts = [
slashOptions.string({ name: "time", description: "The duration of the ban", required: false }),
@ -51,13 +51,7 @@ export const BanSlashCmd = 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;
}
@ -70,10 +64,7 @@ export const BanSlashCmd = modActionsSlashCmd({
if (options.mod) {
if (!canActAsOther) {
pluginData.state.common.sendErrorMessage(
interaction,
"You don't have permission to act as another moderator"
);
pluginData.state.common.sendErrorMessage(interaction, "You don't have permission to act as another moderator");
return;
}

View file

@ -10,11 +10,14 @@ import { banLock } from "../../../../utils/lockNameHelpers";
import { waitForButtonConfirm } from "../../../../utils/waitForInteraction";
import { CasesPlugin } from "../../../Cases/CasesPlugin";
import { LogsPlugin } from "../../../Logs/LogsPlugin";
import { ModActionsPluginType } from "../../types";
import { handleAttachmentLinkDetectionAndGetRestriction } from "../../functions/attachmentLinkReaction";
import { banUserId } from "../../functions/banUserId";
import { formatReasonWithAttachments, formatReasonWithMessageLinkForAttachments } from "../../functions/formatReasonForAttachments";
import {
formatReasonWithAttachments,
formatReasonWithMessageLinkForAttachments,
} from "../../functions/formatReasonForAttachments";
import { isBanned } from "../../functions/isBanned";
import { ModActionsPluginType } from "../../types";
export async function actualBanCmd(
pluginData: GuildPluginData<ModActionsPluginType>,
@ -74,10 +77,7 @@ export async function actualBanCmd(
);
if (!reply) {
pluginData.state.common.sendErrorMessage(
context,
"User already banned, update cancelled by moderator"
);
pluginData.state.common.sendErrorMessage(context, "User already banned, update cancelled by moderator");
lock.unlock();
return;
}

View file

@ -1,6 +1,6 @@
import { commandTypeHelpers as ct } from "../../../../commandTypes";
import { actualCaseCmd } from "./actualCaseCmd";
import { modActionsMsgCmd } from "../../types";
import { actualCaseCmd } from "./actualCaseCmd";
const opts = {
show: ct.switchOption({ def: false, shortcut: "sh" }),

View file

@ -1,6 +1,6 @@
import { slashOptions } from "knub";
import { actualCaseCmd } from "./actualCaseCmd";
import { modActionsSlashCmd } from "../../types";
import { actualCaseCmd } from "./actualCaseCmd";
const opts = [
slashOptions.boolean({ name: "show", description: "To make the result visible to everyone", required: false }),

View file

@ -1,6 +1,6 @@
import { commandTypeHelpers as ct } from "../../../../commandTypes";
import { actualCasesCmd } from "./actualCasesCmd";
import { modActionsMsgCmd } from "../../types";
import { actualCasesCmd } from "./actualCasesCmd";
const opts = {
mod: ct.userId({ option: true }),

View file

@ -1,7 +1,7 @@
import { GuildMember } from "discord.js";
import { slashOptions } from "knub";
import { actualCasesCmd } from "./actualCasesCmd";
import { modActionsSlashCmd } from "../../types";
import { actualCasesCmd } from "./actualCasesCmd";
const opts = [
slashOptions.user({ name: "user", description: "The user to show cases for", required: false }),

View file

@ -1,7 +1,7 @@
import { commandTypeHelpers as ct } from "../../../../commandTypes";
import { resolveMember, resolveUser, UnknownUser } from "../../../../utils";
import { actualCasesCmd } from "./actualCasesCmd";
import { modActionsMsgCmd } from "../../types";
import { actualCasesCmd } from "./actualCasesCmd";
const opts = {
mod: ct.userId({ option: true }),

View file

@ -159,13 +159,7 @@ async function casesModCmd(
const totalCases = await casesPlugin.getTotalCasesByMod(modId ?? author.id, casesFilters);
if (totalCases === 0) {
pluginData.state.common.sendErrorMessage(
context,
`No cases by **${modName}**`,
undefined,
undefined,
!show
);
pluginData.state.common.sendErrorMessage(context, `No cases by **${modName}**`, undefined, undefined, !show);
return;
}

View file

@ -1,7 +1,7 @@
import { commandTypeHelpers as ct } from "../../../../commandTypes";
import { trimLines } from "../../../../utils";
import { actualDeleteCaseCmd } from "./actualDeleteCaseCmd";
import { modActionsMsgCmd } from "../../types";
import { actualDeleteCaseCmd } from "./actualDeleteCaseCmd";
export const DeleteCaseMsgCmd = modActionsMsgCmd({
trigger: ["delete_case", "deletecase"],

View file

@ -1,7 +1,7 @@
import { GuildMember } from "discord.js";
import { slashOptions } from "knub";
import { actualDeleteCaseCmd } from "./actualDeleteCaseCmd";
import { modActionsSlashCmd } from "../../types";
import { actualDeleteCaseCmd } from "./actualDeleteCaseCmd";
const opts = [slashOptions.boolean({ name: "force", description: "Whether or not to force delete", required: false })];

View file

@ -82,15 +82,12 @@ export async function actualDeleteCaseCmd(
: "";
const amt = validCases.length - cancelled;
if (amt === 0) {
pluginData.state.common.sendErrorMessage(
context,
"All deletions were cancelled, no cases were deleted."
);
pluginData.state.common.sendErrorMessage(context, "All deletions were cancelled, no cases were deleted.");
return;
}
pluginData.state.common.sendSuccessMessage(
context,
`${amt} case${amt === 1 ? " was" : "s were"} deleted!${failedAddendum}`
`${amt} case${amt === 1 ? " was" : "s were"} deleted!${failedAddendum}`,
);
}

View file

@ -1,9 +1,9 @@
import { commandTypeHelpers as ct } from "../../../../commandTypes";
import { canActOn, hasPermission } from "../../../../pluginUtils";
import { resolveMember, resolveUser } from "../../../../utils";
import { actualForceBanCmd } from "./actualForceBanCmd";
import { isBanned } from "../../functions/isBanned";
import { modActionsMsgCmd } from "../../types";
import { actualForceBanCmd } from "./actualForceBanCmd";
const opts = {
mod: ct.member({ option: true }),

View file

@ -3,9 +3,9 @@ import { slashOptions } from "knub";
import { hasPermission } from "../../../../pluginUtils";
import { convertDelayStringToMS, resolveMember } from "../../../../utils";
import { generateAttachmentSlashOptions, retrieveMultipleOptions } from "../../../../utils/multipleSlashOptions";
import { actualForceBanCmd } from "./actualForceBanCmd";
import { modActionsSlashCmd } from "../../types";
import { NUMBER_ATTACHMENTS_CASE_CREATION } from "../constants";
import { actualForceBanCmd } from "./actualForceBanCmd";
const opts = [
slashOptions.string({ name: "reason", description: "The reason", required: false }),
@ -29,13 +29,7 @@ export const ForceBanSlashCmd = 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;
}
@ -48,10 +42,7 @@ export const ForceBanSlashCmd = modActionsSlashCmd({
if (options.mod) {
if (!canActAsOther) {
pluginData.state.common.sendErrorMessage(
interaction,
"You don't have permission to act as another moderator"
);
pluginData.state.common.sendErrorMessage(interaction, "You don't have permission to act as another moderator");
return;
}

View file

@ -5,10 +5,13 @@ import { LogType } from "../../../../data/LogType";
import { DAYS, MINUTES, UnknownUser } from "../../../../utils";
import { CasesPlugin } from "../../../Cases/CasesPlugin";
import { LogsPlugin } from "../../../Logs/LogsPlugin";
import { IgnoredEventType, ModActionsPluginType } from "../../types";
import { handleAttachmentLinkDetectionAndGetRestriction } from "../../functions/attachmentLinkReaction";
import { formatReasonWithAttachments, formatReasonWithMessageLinkForAttachments } from "../../functions/formatReasonForAttachments";
import {
formatReasonWithAttachments,
formatReasonWithMessageLinkForAttachments,
} from "../../functions/formatReasonForAttachments";
import { ignoreEvent } from "../../functions/ignoreEvent";
import { IgnoredEventType, ModActionsPluginType } from "../../types";
export async function actualForceBanCmd(
pluginData: GuildPluginData<ModActionsPluginType>,

View file

@ -1,9 +1,9 @@
import { commandTypeHelpers as ct } from "../../../../commandTypes";
import { canActOn, hasPermission } from "../../../../pluginUtils";
import { resolveMember, resolveUser } from "../../../../utils";
import { actualMuteCmd } from "../mute/actualMuteCmd";
import { readContactMethodsFromArgs } from "../../functions/readContactMethodsFromArgs";
import { modActionsMsgCmd } from "../../types";
import { actualMuteCmd } from "../mute/actualMuteCmd";
const opts = {
mod: ct.member({ option: true }),

View file

@ -3,10 +3,10 @@ import { slashOptions } from "knub";
import { hasPermission } from "../../../../pluginUtils";
import { UserNotificationMethod, convertDelayStringToMS, resolveMember } from "../../../../utils";
import { generateAttachmentSlashOptions, retrieveMultipleOptions } from "../../../../utils/multipleSlashOptions";
import { actualMuteCmd } from "../mute/actualMuteCmd";
import { readContactMethodsFromArgs } from "../../functions/readContactMethodsFromArgs";
import { modActionsSlashCmd } from "../../types";
import { NUMBER_ATTACHMENTS_CASE_CREATION } from "../constants";
import { actualMuteCmd } from "../mute/actualMuteCmd";
const opts = [
slashOptions.string({ name: "time", description: "The duration of the mute", required: false }),
@ -46,13 +46,7 @@ export const ForceMuteSlashCmd = 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;
}
@ -66,10 +60,7 @@ export const ForceMuteSlashCmd = modActionsSlashCmd({
if (options.mod) {
if (!canActAsOther) {
pluginData.state.common.sendErrorMessage(
interaction,
"You don't have permission to act as another moderator"
);
pluginData.state.common.sendErrorMessage(interaction, "You don't have permission to act as another moderator");
return;
}

View file

@ -1,8 +1,8 @@
import { commandTypeHelpers as ct } from "../../../../commandTypes";
import { canActOn, hasPermission } from "../../../../pluginUtils";
import { resolveMember, resolveUser } from "../../../../utils";
import { actualUnmuteCmd } from "../unmute/actualUnmuteCmd";
import { modActionsMsgCmd } from "../../types";
import { actualUnmuteCmd } from "../unmute/actualUnmuteCmd";
const opts = {
mod: ct.member({ option: true }),

View file

@ -3,9 +3,9 @@ import { slashOptions } from "knub";
import { hasPermission } from "../../../../pluginUtils";
import { convertDelayStringToMS, resolveMember } from "../../../../utils";
import { generateAttachmentSlashOptions, retrieveMultipleOptions } from "../../../../utils/multipleSlashOptions";
import { actualUnmuteCmd } from "../unmute/actualUnmuteCmd";
import { modActionsSlashCmd } from "../../types";
import { NUMBER_ATTACHMENTS_CASE_CREATION } from "../constants";
import { actualUnmuteCmd } from "../unmute/actualUnmuteCmd";
const opts = [
slashOptions.string({ name: "time", description: "The duration of the unmute", required: false }),
@ -30,13 +30,7 @@ export const ForceUnmuteSlashCmd = 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;
}
@ -50,10 +44,7 @@ export const ForceUnmuteSlashCmd = modActionsSlashCmd({
if (options.mod) {
if (!canActAsOther) {
pluginData.state.common.sendErrorMessage(
interaction,
"You don't have permission to act as another moderator"
);
pluginData.state.common.sendErrorMessage(interaction, "You don't have permission to act as another moderator");
return;
}

View file

@ -1,6 +1,6 @@
import { commandTypeHelpers as ct } from "../../../../commandTypes";
import { actualHideCaseCmd } from "./actualHideCaseCmd";
import { modActionsMsgCmd } from "../../types";
import { actualHideCaseCmd } from "./actualHideCaseCmd";
export const HideCaseMsgCmd = modActionsMsgCmd({
trigger: ["hide", "hidecase", "hide_case"],

View file

@ -1,6 +1,6 @@
import { slashOptions } from "knub";
import { actualHideCaseCmd } from "./actualHideCaseCmd";
import { modActionsSlashCmd } from "../../types";
import { actualHideCaseCmd } from "./actualHideCaseCmd";
export const HideCaseSlashCmd = modActionsSlashCmd({
name: "hidecase",

View file

@ -1,9 +1,9 @@
import { hasPermission } from "knub/helpers";
import { commandTypeHelpers as ct } from "../../../../commandTypes";
import { resolveUser } from "../../../../utils";
import { actualKickCmd } from "./actualKickCmd";
import { readContactMethodsFromArgs } from "../../functions/readContactMethodsFromArgs";
import { modActionsMsgCmd } from "../../types";
import { actualKickCmd } from "./actualKickCmd";
const opts = {
mod: ct.member({ option: true }),

View file

@ -3,10 +3,10 @@ import { slashOptions } from "knub";
import { hasPermission } from "../../../../pluginUtils";
import { UserNotificationMethod, resolveMember } from "../../../../utils";
import { generateAttachmentSlashOptions, retrieveMultipleOptions } from "../../../../utils/multipleSlashOptions";
import { actualKickCmd } from "./actualKickCmd";
import { readContactMethodsFromArgs } from "../../functions/readContactMethodsFromArgs";
import { modActionsSlashCmd } from "../../types";
import { NUMBER_ATTACHMENTS_CASE_CREATION } from "../constants";
import { actualKickCmd } from "./actualKickCmd";
const opts = [
slashOptions.string({ name: "reason", description: "The reason", required: false }),
@ -50,13 +50,7 @@ export const KickSlashCmd = 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;
}
@ -69,10 +63,7 @@ export const KickSlashCmd = modActionsSlashCmd({
if (options.mod) {
if (!canActAsOther) {
pluginData.state.common.sendErrorMessage(
interaction,
"You don't have permission to act as another moderator"
);
pluginData.state.common.sendErrorMessage(interaction, "You don't have permission to act as another moderator");
return;
}

View file

@ -3,12 +3,15 @@ import { GuildPluginData } from "knub";
import { LogType } from "../../../../data/LogType";
import { canActOn } from "../../../../pluginUtils";
import { DAYS, SECONDS, UnknownUser, UserNotificationMethod, renderUsername, resolveMember } from "../../../../utils";
import { IgnoredEventType, ModActionsPluginType } from "../../types";
import { handleAttachmentLinkDetectionAndGetRestriction } from "../../functions/attachmentLinkReaction";
import { formatReasonWithAttachments, formatReasonWithMessageLinkForAttachments } from "../../functions/formatReasonForAttachments";
import {
formatReasonWithAttachments,
formatReasonWithMessageLinkForAttachments,
} from "../../functions/formatReasonForAttachments";
import { ignoreEvent } from "../../functions/ignoreEvent";
import { isBanned } from "../../functions/isBanned";
import { kickMember } from "../../functions/kickMember";
import { IgnoredEventType, ModActionsPluginType } from "../../types";
export async function actualKickCmd(
pluginData: GuildPluginData<ModActionsPluginType>,
@ -71,9 +74,7 @@ export async function actualKickCmd(
try {
await pluginData.guild.bans.remove(memberToKick.id, "kick -clean");
} catch {
pluginData.state.common.sendErrorMessage(
context,
"Failed to unban the user after banning them (-clean)");
pluginData.state.common.sendErrorMessage(context, "Failed to unban the user after banning them (-clean)");
}
}

View file

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

View file

@ -1,9 +1,9 @@
import { GuildMember } from "discord.js";
import { slashOptions } from "knub";
import { generateAttachmentSlashOptions, retrieveMultipleOptions } from "../../../../utils/multipleSlashOptions";
import { actualMassBanCmd } from "./actualMassBanCmd";
import { modActionsSlashCmd } from "../../types";
import { NUMBER_ATTACHMENTS_CASE_CREATION } from "../constants";
import { actualMassBanCmd } from "./actualMassBanCmd";
const opts = [
slashOptions.string({ name: "reason", description: "The reason", required: false }),
@ -30,13 +30,7 @@ export const MassBanSlashCmd = 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

@ -7,10 +7,13 @@ import { canActOn, getContextChannel, isContextInteraction, sendContextResponse
import { DAYS, MINUTES, SECONDS, noop } from "../../../../utils";
import { CasesPlugin } from "../../../Cases/CasesPlugin";
import { LogsPlugin } from "../../../Logs/LogsPlugin";
import { IgnoredEventType, ModActionsPluginType } from "../../types";
import { handleAttachmentLinkDetectionAndGetRestriction } from "../../functions/attachmentLinkReaction";
import { formatReasonWithAttachments, formatReasonWithMessageLinkForAttachments } from "../../functions/formatReasonForAttachments";
import {
formatReasonWithAttachments,
formatReasonWithMessageLinkForAttachments,
} from "../../functions/formatReasonForAttachments";
import { ignoreEvent } from "../../functions/ignoreEvent";
import { IgnoredEventType, ModActionsPluginType } from "../../types";
export async function actualMassBanCmd(
pluginData: GuildPluginData<ModActionsPluginType>,
@ -37,9 +40,7 @@ export async function actualMassBanCmd(
for (const userId of userIds) {
const member = pluginData.guild.members.cache.get(userId as Snowflake); // TODO: Get members on demand?
if (member && !canActOn(pluginData, author, member)) {
pluginData.state.common.sendErrorMessage(
context,
"Cannot massban one or more users: insufficient permissions");
pluginData.state.common.sendErrorMessage(context, "Cannot massban one or more users: insufficient permissions");
return;
}
}
@ -157,14 +158,14 @@ export async function actualMassBanCmd(
if (failedBans.length) {
pluginData.state.common.sendSuccessMessage(
context,
`Banned ${successfulBanCount} users in ${formattedTimeTaken}, ${
failedBans.length
} failed: ${failedBans.join(" ")}`,
`Banned ${successfulBanCount} users in ${formattedTimeTaken}, ${failedBans.length} failed: ${failedBans.join(
" ",
)}`,
);
} else {
pluginData.state.common.sendSuccessMessage(
context,
`Banned ${successfulBanCount} users successfully in ${formattedTimeTaken}`
`Banned ${successfulBanCount} users successfully in ${formattedTimeTaken}`,
);
}
}

View file

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

View file

@ -1,9 +1,9 @@
import { GuildMember } from "discord.js";
import { slashOptions } from "knub";
import { generateAttachmentSlashOptions, retrieveMultipleOptions } from "../../../../utils/multipleSlashOptions";
import { actualMassMuteCmd } from "./actualMassMuteCmd";
import { modActionsSlashCmd } from "../../types";
import { NUMBER_ATTACHMENTS_CASE_CREATION } from "../constants";
import { actualMassMuteCmd } from "./actualMassMuteCmd";
const opts = [
slashOptions.string({ name: "reason", description: "The reason", required: false }),
@ -30,13 +30,7 @@ export const MassMuteSlashSlashCmd = 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

@ -5,9 +5,12 @@ import { logger } from "../../../../logger";
import { canActOn, isContextInteraction, sendContextResponse } from "../../../../pluginUtils";
import { LogsPlugin } from "../../../Logs/LogsPlugin";
import { MutesPlugin } from "../../../Mutes/MutesPlugin";
import { ModActionsPluginType } from "../../types";
import { handleAttachmentLinkDetectionAndGetRestriction } from "../../functions/attachmentLinkReaction";
import { formatReasonWithAttachments, formatReasonWithMessageLinkForAttachments } from "../../functions/formatReasonForAttachments";
import {
formatReasonWithAttachments,
formatReasonWithMessageLinkForAttachments,
} from "../../functions/formatReasonForAttachments";
import { ModActionsPluginType } from "../../types";
export async function actualMassMuteCmd(
pluginData: GuildPluginData<ModActionsPluginType>,
@ -34,10 +37,7 @@ export async function actualMassMuteCmd(
for (const userId of userIds) {
const member = pluginData.guild.members.cache.get(userId as Snowflake);
if (member && !canActOn(pluginData, author, member)) {
pluginData.state.common.sendErrorMessage(
context,
"Cannot massmute one or more users: insufficient permissions"
);
pluginData.state.common.sendErrorMessage(context, "Cannot massmute one or more users: insufficient permissions");
return;
}
}

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({

View file

@ -2,10 +2,10 @@ import { commandTypeHelpers as ct } from "../../../../commandTypes";
import { canActOn, hasPermission } from "../../../../pluginUtils";
import { resolveMember, resolveUser } from "../../../../utils";
import { waitForButtonConfirm } from "../../../../utils/waitForInteraction";
import { actualMuteCmd } from "./actualMuteCmd";
import { isBanned } from "../../functions/isBanned";
import { readContactMethodsFromArgs } from "../../functions/readContactMethodsFromArgs";
import { modActionsMsgCmd } from "../../types";
import { actualMuteCmd } from "./actualMuteCmd";
const opts = {
mod: ct.member({ option: true }),
@ -49,7 +49,7 @@ export const MuteMsgCmd = modActionsMsgCmd({
if (_isBanned) {
pluginData.state.common.sendErrorMessage(
msg,
`User is banned. Use \`${prefix}forcemute\` if you want to mute them anyway.`
`User is banned. Use \`${prefix}forcemute\` if you want to mute them anyway.`,
);
return;
} else {

View file

@ -4,11 +4,11 @@ import { canActOn, hasPermission } from "../../../../pluginUtils";
import { UserNotificationMethod, convertDelayStringToMS, resolveMember } from "../../../../utils";
import { generateAttachmentSlashOptions, retrieveMultipleOptions } from "../../../../utils/multipleSlashOptions";
import { waitForButtonConfirm } from "../../../../utils/waitForInteraction";
import { actualMuteCmd } from "./actualMuteCmd";
import { isBanned } from "../../functions/isBanned";
import { readContactMethodsFromArgs } from "../../functions/readContactMethodsFromArgs";
import { modActionsSlashCmd } from "../../types";
import { NUMBER_ATTACHMENTS_CASE_CREATION } from "../constants";
import { actualMuteCmd } from "./actualMuteCmd";
const opts = [
slashOptions.string({ name: "time", description: "The duration of the mute", required: false }),
@ -54,7 +54,7 @@ export const MuteSlashCmd = modActionsSlashCmd({
if (_isBanned) {
pluginData.state.common.sendErrorMessage(
interaction,
`User is banned. Use \`${prefix}forcemute\` if you want to mute them anyway.`
`User is banned. Use \`${prefix}forcemute\` if you want to mute them anyway.`,
);
return;
} else {
@ -66,10 +66,7 @@ export const MuteSlashCmd = modActionsSlashCmd({
);
if (!reply) {
pluginData.state.common.sendErrorMessage(
interaction,
"User not on server, mute cancelled by moderator"
);
pluginData.state.common.sendErrorMessage(interaction, "User not on server, mute cancelled by moderator");
return;
}
}
@ -90,10 +87,7 @@ export const MuteSlashCmd = modActionsSlashCmd({
if (options.mod) {
if (!canActAsOther) {
pluginData.state.common.sendErrorMessage(
interaction,
"You don't have permission to act as another moderator"
);
pluginData.state.common.sendErrorMessage(interaction, "You don't have permission to act as another moderator");
return;
}

View file

@ -12,9 +12,12 @@ import {
} from "../../../../utils";
import { MutesPlugin } from "../../../Mutes/MutesPlugin";
import { MuteResult } from "../../../Mutes/types";
import { ModActionsPluginType } from "../../types";
import { handleAttachmentLinkDetectionAndGetRestriction } from "../../functions/attachmentLinkReaction";
import { formatReasonWithAttachments, formatReasonWithMessageLinkForAttachments } from "../../functions/formatReasonForAttachments";
import {
formatReasonWithAttachments,
formatReasonWithMessageLinkForAttachments,
} from "../../functions/formatReasonForAttachments";
import { ModActionsPluginType } from "../../types";
/**
* The actual function run by both !mute and !forcemute.
@ -56,10 +59,7 @@ export async function actualMuteCmd(
});
} catch (e) {
if (e instanceof RecoverablePluginError && e.code === ERRORS.NO_MUTE_ROLE_IN_CONFIG) {
pluginData.state.common.sendErrorMessage(
context,
"Could not mute the user: no mute role set in config"
);
pluginData.state.common.sendErrorMessage(context, "Could not mute the user: no mute role set in config");
} else if (isDiscordAPIError(e) && e.code === 10007) {
pluginData.state.common.sendErrorMessage(context, "Could not mute the user: unknown member");
} else {

View file

@ -1,7 +1,7 @@
import { commandTypeHelpers as ct } from "../../../../commandTypes";
import { resolveUser } from "../../../../utils";
import { actualNoteCmd } from "./actualNoteCmd";
import { modActionsMsgCmd } from "../../types";
import { actualNoteCmd } from "./actualNoteCmd";
export const NoteMsgCmd = modActionsMsgCmd({
trigger: "note",

View file

@ -1,8 +1,8 @@
import { slashOptions } from "knub";
import { generateAttachmentSlashOptions, retrieveMultipleOptions } from "../../../../utils/multipleSlashOptions";
import { actualNoteCmd } from "./actualNoteCmd";
import { modActionsSlashCmd } from "../../types";
import { NUMBER_ATTACHMENTS_CASE_CREATION } from "../constants";
import { actualNoteCmd } from "./actualNoteCmd";
const opts = [
slashOptions.string({ name: "note", description: "The note to add to the user", required: false }),
@ -25,13 +25,7 @@ export const NoteSlashCmd = modActionsSlashCmd({
const attachments = retrieveMultipleOptions(NUMBER_ATTACHMENTS_CASE_CREATION, options, "attachment");
if ((!options.note || options.note.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

@ -4,9 +4,9 @@ import { CaseTypes } from "../../../../data/CaseTypes";
import { UnknownUser, renderUsername } from "../../../../utils";
import { CasesPlugin } from "../../../Cases/CasesPlugin";
import { LogsPlugin } from "../../../Logs/LogsPlugin";
import { ModActionsPluginType } from "../../types";
import { handleAttachmentLinkDetectionAndGetRestriction } from "../../functions/attachmentLinkReaction";
import { formatReasonWithMessageLinkForAttachments } from "../../functions/formatReasonForAttachments";
import { ModActionsPluginType } from "../../types";
export async function actualNoteCmd(
pluginData: GuildPluginData<ModActionsPluginType>,

View file

@ -1,8 +1,8 @@
import { commandTypeHelpers as ct } from "../../../../commandTypes";
import { hasPermission } from "../../../../pluginUtils";
import { resolveUser } from "../../../../utils";
import { actualUnbanCmd } from "./actualUnbanCmd";
import { modActionsMsgCmd } from "../../types";
import { actualUnbanCmd } from "./actualUnbanCmd";
const opts = {
mod: ct.member({ option: true }),

View file

@ -3,9 +3,9 @@ import { slashOptions } from "knub";
import { hasPermission } from "../../../../pluginUtils";
import { resolveMember } from "../../../../utils";
import { generateAttachmentSlashOptions, retrieveMultipleOptions } from "../../../../utils/multipleSlashOptions";
import { actualUnbanCmd } from "./actualUnbanCmd";
import { modActionsSlashCmd } from "../../types";
import { NUMBER_ATTACHMENTS_CASE_CREATION } from "../constants";
import { actualUnbanCmd } from "./actualUnbanCmd";
const opts = [
slashOptions.string({ name: "reason", description: "The reason", required: false }),
@ -29,13 +29,7 @@ export const UnbanSlashCmd = 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;
}
@ -48,10 +42,7 @@ export const UnbanSlashCmd = modActionsSlashCmd({
if (options.mod) {
if (!canActAsOther) {
pluginData.state.common.sendErrorMessage(
interaction,
"You don't have permission to act as another moderator"
);
pluginData.state.common.sendErrorMessage(interaction, "You don't have permission to act as another moderator");
return;
}

View file

@ -6,10 +6,10 @@ import { clearExpiringTempban } from "../../../../data/loops/expiringTempbansLoo
import { UnknownUser } 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 { IgnoredEventType, ModActionsPluginType } from "../../types";
export async function actualUnbanCmd(
pluginData: GuildPluginData<ModActionsPluginType>,
@ -31,10 +31,7 @@ export async function actualUnbanCmd(
ignoreEvent(pluginData, IgnoredEventType.Unban, user.id);
await pluginData.guild.bans.remove(user.id as Snowflake, formattedReason ?? undefined);
} catch {
pluginData.state.common.sendErrorMessage(
context,
"Failed to unban member; are you sure they're banned?"
);
pluginData.state.common.sendErrorMessage(context, "Failed to unban member; are you sure they're banned?");
return;
}

View file

@ -1,6 +1,6 @@
import { commandTypeHelpers as ct } from "../../../../commandTypes";
import { actualHideCaseCmd } from "../hidecase/actualHideCaseCmd";
import { modActionsMsgCmd } from "../../types";
import { actualHideCaseCmd } from "../hidecase/actualHideCaseCmd";
export const UnhideCaseMsgCmd = modActionsMsgCmd({
trigger: ["unhide", "unhidecase", "unhide_case"],

View file

@ -1,6 +1,6 @@
import { slashOptions } from "knub";
import { actualUnhideCaseCmd } from "./actualUnhideCaseCmd";
import { modActionsSlashCmd } from "../../types";
import { actualUnhideCaseCmd } from "./actualUnhideCaseCmd";
export const UnhideCaseSlashCmd = modActionsSlashCmd({
name: "unhidecase",

View file

@ -32,6 +32,6 @@ export async function actualUnhideCaseCmd(
const amt = caseNumbers.length - failed.length;
pluginData.state.common.sendSuccessMessage(
context,
`${amt} case${amt === 1 ? " is" : "s are"} no longer hidden!${failedAddendum}`
`${amt} case${amt === 1 ? " is" : "s are"} no longer hidden!${failedAddendum}`,
);
}

View file

@ -3,9 +3,9 @@ import { canActOn, hasPermission } from "../../../../pluginUtils";
import { resolveMember, resolveUser } from "../../../../utils";
import { waitForButtonConfirm } from "../../../../utils/waitForInteraction";
import { MutesPlugin } from "../../../Mutes/MutesPlugin";
import { actualUnmuteCmd } from "./actualUnmuteCmd";
import { isBanned } from "../../functions/isBanned";
import { modActionsMsgCmd } from "../../types";
import { actualUnmuteCmd } from "./actualUnmuteCmd";
const opts = {
mod: ct.member({ option: true }),
@ -59,7 +59,7 @@ export const UnmuteMsgCmd = modActionsMsgCmd({
if (banned) {
pluginData.state.common.sendErrorMessage(
msg,
`User is banned. Use \`${prefix}forceunmute\` to unmute them anyway.`
`User is banned. Use \`${prefix}forceunmute\` to unmute them anyway.`,
);
return;
} else {

View file

@ -5,10 +5,10 @@ import { convertDelayStringToMS, resolveMember } from "../../../../utils";
import { generateAttachmentSlashOptions, retrieveMultipleOptions } from "../../../../utils/multipleSlashOptions";
import { waitForButtonConfirm } from "../../../../utils/waitForInteraction";
import { MutesPlugin } from "../../../Mutes/MutesPlugin";
import { actualUnmuteCmd } from "./actualUnmuteCmd";
import { isBanned } from "../../functions/isBanned";
import { modActionsSlashCmd } from "../../types";
import { NUMBER_ATTACHMENTS_CASE_CREATION } from "../constants";
import { actualUnmuteCmd } from "./actualUnmuteCmd";
const opts = [
slashOptions.string({ name: "time", description: "The duration of the unmute", required: false }),
@ -33,13 +33,7 @@ export const UnmuteSlashCmd = 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;
}
@ -64,7 +58,7 @@ export const UnmuteSlashCmd = modActionsSlashCmd({
if (banned) {
pluginData.state.common.sendErrorMessage(
interaction,
`User is banned. Use \`${prefix}forceunmute\` to unmute them anyway.`
`User is banned. Use \`${prefix}forceunmute\` to unmute them anyway.`,
);
return;
} else {
@ -76,10 +70,7 @@ export const UnmuteSlashCmd = modActionsSlashCmd({
);
if (!reply) {
pluginData.state.common.sendErrorMessage(
interaction,
"User not on server, unmute cancelled by moderator"
);
pluginData.state.common.sendErrorMessage(interaction, "User not on server, unmute cancelled by moderator");
return;
}
}
@ -100,10 +91,7 @@ export const UnmuteSlashCmd = modActionsSlashCmd({
if (options.mod) {
if (!canActAsOther) {
pluginData.state.common.sendErrorMessage(
interaction,
"You don't have permission to act as another moderator"
);
pluginData.state.common.sendErrorMessage(interaction, "You don't have permission to act as another moderator");
return;
}

View file

@ -3,9 +3,9 @@ import humanizeDuration from "humanize-duration";
import { GuildPluginData } from "knub";
import { UnknownUser, asSingleLine, renderUsername } from "../../../../utils";
import { MutesPlugin } from "../../../Mutes/MutesPlugin";
import { ModActionsPluginType } from "../../types";
import { handleAttachmentLinkDetectionAndGetRestriction } from "../../functions/attachmentLinkReaction";
import { formatReasonWithMessageLinkForAttachments } from "../../functions/formatReasonForAttachments";
import { ModActionsPluginType } from "../../types";
export async function actualUnmuteCmd(
pluginData: GuildPluginData<ModActionsPluginType>,

View file

@ -1,10 +1,10 @@
import { commandTypeHelpers as ct } from "../../../../commandTypes";
import { canActOn, hasPermission } from "../../../../pluginUtils";
import { errorMessage, resolveMember, resolveUser } from "../../../../utils";
import { actualWarnCmd } from "./actualWarnCmd";
import { isBanned } from "../../functions/isBanned";
import { readContactMethodsFromArgs } from "../../functions/readContactMethodsFromArgs";
import { modActionsMsgCmd } from "../../types";
import { actualWarnCmd } from "./actualWarnCmd";
export const WarnMsgCmd = modActionsMsgCmd({
trigger: "warn",

View file

@ -3,11 +3,11 @@ import { slashOptions } from "knub";
import { canActOn, hasPermission } from "../../../../pluginUtils";
import { UserNotificationMethod, resolveMember } from "../../../../utils";
import { generateAttachmentSlashOptions, retrieveMultipleOptions } from "../../../../utils/multipleSlashOptions";
import { actualWarnCmd } from "./actualWarnCmd";
import { isBanned } from "../../functions/isBanned";
import { readContactMethodsFromArgs } from "../../functions/readContactMethodsFromArgs";
import { modActionsSlashCmd } from "../../types";
import { NUMBER_ATTACHMENTS_CASE_CREATION } from "../constants";
import { actualWarnCmd } from "./actualWarnCmd";
const opts = [
slashOptions.string({ name: "reason", description: "The reason", required: false }),
@ -51,7 +51,7 @@ export const WarnSlashCmd = modActionsSlashCmd({
"Text or attachment required",
undefined,
undefined,
true
true,
);
return;
@ -86,7 +86,7 @@ export const WarnSlashCmd = modActionsSlashCmd({
if (!canActAsOther) {
await pluginData.state.common.sendErrorMessage(
interaction,
"You don't have permission to act as another moderator"
"You don't have permission to act as another moderator",
);
return;
}

Some files were not shown because too many files have changed in this diff Show more