mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-06-08 00:05:01 +00:00
refactor: convert /backend to ESM
This commit is contained in:
parent
31d74c05aa
commit
5772e27cda
766 changed files with 3473 additions and 3500 deletions
|
@ -1,53 +1,53 @@
|
|||
import { Message } from "discord.js";
|
||||
import { EventEmitter } from "events";
|
||||
import { guildPlugin } from "knub";
|
||||
import { Queue } from "../../Queue";
|
||||
import { GuildCases } from "../../data/GuildCases";
|
||||
import { onGuildEvent } from "../../data/GuildEvents";
|
||||
import { GuildLogs } from "../../data/GuildLogs";
|
||||
import { GuildMutes } from "../../data/GuildMutes";
|
||||
import { GuildTempbans } from "../../data/GuildTempbans";
|
||||
import { makePublicFn, mapToPublicFn } from "../../pluginUtils";
|
||||
import { MINUTES } from "../../utils";
|
||||
import { CasesPlugin } from "../Cases/CasesPlugin";
|
||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||
import { MutesPlugin } from "../Mutes/MutesPlugin";
|
||||
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
||||
import { AddCaseCmd } from "./commands/AddCaseCmd";
|
||||
import { BanCmd } from "./commands/BanCmd";
|
||||
import { CaseCmd } from "./commands/CaseCmd";
|
||||
import { CasesModCmd } from "./commands/CasesModCmd";
|
||||
import { CasesUserCmd } from "./commands/CasesUserCmd";
|
||||
import { DeleteCaseCmd } from "./commands/DeleteCaseCmd";
|
||||
import { ForcebanCmd } from "./commands/ForcebanCmd";
|
||||
import { ForcemuteCmd } from "./commands/ForcemuteCmd";
|
||||
import { ForceUnmuteCmd } from "./commands/ForceunmuteCmd";
|
||||
import { HideCaseCmd } from "./commands/HideCaseCmd";
|
||||
import { KickCmd } from "./commands/KickCmd";
|
||||
import { MassbanCmd } from "./commands/MassBanCmd";
|
||||
import { MassunbanCmd } from "./commands/MassUnbanCmd";
|
||||
import { MassmuteCmd } from "./commands/MassmuteCmd";
|
||||
import { MuteCmd } from "./commands/MuteCmd";
|
||||
import { NoteCmd } from "./commands/NoteCmd";
|
||||
import { SoftbanCmd } from "./commands/SoftbanCommand";
|
||||
import { UnbanCmd } from "./commands/UnbanCmd";
|
||||
import { UnhideCaseCmd } from "./commands/UnhideCaseCmd";
|
||||
import { UnmuteCmd } from "./commands/UnmuteCmd";
|
||||
import { UpdateCmd } from "./commands/UpdateCmd";
|
||||
import { WarnCmd } from "./commands/WarnCmd";
|
||||
import { AuditLogEvents } from "./events/AuditLogEvents";
|
||||
import { CreateBanCaseOnManualBanEvt } from "./events/CreateBanCaseOnManualBanEvt";
|
||||
import { CreateUnbanCaseOnManualUnbanEvt } from "./events/CreateUnbanCaseOnManualUnbanEvt";
|
||||
import { PostAlertOnMemberJoinEvt } from "./events/PostAlertOnMemberJoinEvt";
|
||||
import { banUserId } from "./functions/banUserId";
|
||||
import { clearTempban } from "./functions/clearTempban";
|
||||
import { hasMutePermission } from "./functions/hasMutePerm";
|
||||
import { kickMember } from "./functions/kickMember";
|
||||
import { offModActionsEvent } from "./functions/offModActionsEvent";
|
||||
import { onModActionsEvent } from "./functions/onModActionsEvent";
|
||||
import { updateCase } from "./functions/updateCase";
|
||||
import { warnMember } from "./functions/warnMember";
|
||||
import { ModActionsPluginType, zModActionsConfig } from "./types";
|
||||
import { Queue } from "../../Queue.js";
|
||||
import { GuildCases } from "../../data/GuildCases.js";
|
||||
import { onGuildEvent } from "../../data/GuildEvents.js";
|
||||
import { GuildLogs } from "../../data/GuildLogs.js";
|
||||
import { GuildMutes } from "../../data/GuildMutes.js";
|
||||
import { GuildTempbans } from "../../data/GuildTempbans.js";
|
||||
import { makePublicFn, mapToPublicFn } from "../../pluginUtils.js";
|
||||
import { MINUTES } from "../../utils.js";
|
||||
import { CasesPlugin } from "../Cases/CasesPlugin.js";
|
||||
import { LogsPlugin } from "../Logs/LogsPlugin.js";
|
||||
import { MutesPlugin } from "../Mutes/MutesPlugin.js";
|
||||
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin.js";
|
||||
import { AddCaseCmd } from "./commands/AddCaseCmd.js";
|
||||
import { BanCmd } from "./commands/BanCmd.js";
|
||||
import { CaseCmd } from "./commands/CaseCmd.js";
|
||||
import { CasesModCmd } from "./commands/CasesModCmd.js";
|
||||
import { CasesUserCmd } from "./commands/CasesUserCmd.js";
|
||||
import { DeleteCaseCmd } from "./commands/DeleteCaseCmd.js";
|
||||
import { ForcebanCmd } from "./commands/ForcebanCmd.js";
|
||||
import { ForcemuteCmd } from "./commands/ForcemuteCmd.js";
|
||||
import { ForceUnmuteCmd } from "./commands/ForceunmuteCmd.js";
|
||||
import { HideCaseCmd } from "./commands/HideCaseCmd.js";
|
||||
import { KickCmd } from "./commands/KickCmd.js";
|
||||
import { MassbanCmd } from "./commands/MassBanCmd.js";
|
||||
import { MassunbanCmd } from "./commands/MassUnbanCmd.js";
|
||||
import { MassmuteCmd } from "./commands/MassmuteCmd.js";
|
||||
import { MuteCmd } from "./commands/MuteCmd.js";
|
||||
import { NoteCmd } from "./commands/NoteCmd.js";
|
||||
import { SoftbanCmd } from "./commands/SoftbanCommand.js";
|
||||
import { UnbanCmd } from "./commands/UnbanCmd.js";
|
||||
import { UnhideCaseCmd } from "./commands/UnhideCaseCmd.js";
|
||||
import { UnmuteCmd } from "./commands/UnmuteCmd.js";
|
||||
import { UpdateCmd } from "./commands/UpdateCmd.js";
|
||||
import { WarnCmd } from "./commands/WarnCmd.js";
|
||||
import { AuditLogEvents } from "./events/AuditLogEvents.js";
|
||||
import { CreateBanCaseOnManualBanEvt } from "./events/CreateBanCaseOnManualBanEvt.js";
|
||||
import { CreateUnbanCaseOnManualUnbanEvt } from "./events/CreateUnbanCaseOnManualUnbanEvt.js";
|
||||
import { PostAlertOnMemberJoinEvt } from "./events/PostAlertOnMemberJoinEvt.js";
|
||||
import { banUserId } from "./functions/banUserId.js";
|
||||
import { clearTempban } from "./functions/clearTempban.js";
|
||||
import { hasMutePermission } from "./functions/hasMutePerm.js";
|
||||
import { kickMember } from "./functions/kickMember.js";
|
||||
import { offModActionsEvent } from "./functions/offModActionsEvent.js";
|
||||
import { onModActionsEvent } from "./functions/onModActionsEvent.js";
|
||||
import { updateCase } from "./functions/updateCase.js";
|
||||
import { warnMember } from "./functions/warnMember.js";
|
||||
import { ModActionsPluginType, zModActionsConfig } from "./types.js";
|
||||
|
||||
const defaultOptions = {
|
||||
config: {
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { CaseTypes } from "../../../data/CaseTypes";
|
||||
import { Case } from "../../../data/entities/Case";
|
||||
import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin";
|
||||
import { canActOn, hasPermission, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { renderUsername, resolveMember, resolveUser } from "../../../utils";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments";
|
||||
import { modActionsCmd } from "../types";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
|
||||
import { CaseTypes } from "../../../data/CaseTypes.js";
|
||||
import { Case } from "../../../data/entities/Case.js";
|
||||
import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin.js";
|
||||
import { canActOn, hasPermission, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js";
|
||||
import { renderUsername, resolveMember, resolveUser } from "../../../utils.js";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin.js";
|
||||
import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments.js";
|
||||
import { modActionsCmd } from "../types.js";
|
||||
|
||||
const opts = {
|
||||
mod: ct.member({ option: true }),
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
import humanizeDuration from "humanize-duration";
|
||||
import { getMemberLevel } from "knub/helpers";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { CaseTypes } from "../../../data/CaseTypes";
|
||||
import { clearExpiringTempban, registerExpiringTempban } from "../../../data/loops/expiringTempbansLoop";
|
||||
import { canActOn, hasPermission, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin";
|
||||
import { renderUsername, resolveMember, resolveUser } from "../../../utils";
|
||||
import { banLock } from "../../../utils/lockNameHelpers";
|
||||
import { waitForButtonConfirm } from "../../../utils/waitForInteraction";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { banUserId } from "../functions/banUserId";
|
||||
import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments";
|
||||
import { isBanned } from "../functions/isBanned";
|
||||
import { readContactMethodsFromArgs } from "../functions/readContactMethodsFromArgs";
|
||||
import { modActionsCmd } from "../types";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
|
||||
import { CaseTypes } from "../../../data/CaseTypes.js";
|
||||
import { clearExpiringTempban, registerExpiringTempban } from "../../../data/loops/expiringTempbansLoop.js";
|
||||
import { canActOn, hasPermission, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js";
|
||||
import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin.js";
|
||||
import { renderUsername, resolveMember, resolveUser } from "../../../utils.js";
|
||||
import { banLock } from "../../../utils/lockNameHelpers.js";
|
||||
import { waitForButtonConfirm } from "../../../utils/waitForInteraction.js";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin.js";
|
||||
import { banUserId } from "../functions/banUserId.js";
|
||||
import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments.js";
|
||||
import { isBanned } from "../functions/isBanned.js";
|
||||
import { readContactMethodsFromArgs } from "../functions/readContactMethodsFromArgs.js";
|
||||
import { modActionsCmd } from "../types.js";
|
||||
|
||||
const opts = {
|
||||
mod: ct.member({ option: true }),
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin";
|
||||
import { sendErrorMessage } from "../../../pluginUtils";
|
||||
import { modActionsCmd } from "../types";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
|
||||
import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin.js";
|
||||
import { sendErrorMessage } from "../../../pluginUtils.js";
|
||||
import { modActionsCmd } from "../types.js";
|
||||
|
||||
export const CaseCmd = modActionsCmd({
|
||||
trigger: "case",
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import { APIEmbed } from "discord.js";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { sendErrorMessage } from "../../../pluginUtils";
|
||||
import { UnknownUser, emptyEmbedValue, renderUsername, resolveMember, resolveUser, trimLines } from "../../../utils";
|
||||
import { asyncMap } from "../../../utils/async";
|
||||
import { createPaginatedMessage } from "../../../utils/createPaginatedMessage";
|
||||
import { getGuildPrefix } from "../../../utils/getGuildPrefix";
|
||||
import { CasesPlugin } from "../../Cases/CasesPlugin";
|
||||
import { modActionsCmd } from "../types";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
|
||||
import { sendErrorMessage } from "../../../pluginUtils.js";
|
||||
import { UnknownUser, emptyEmbedValue, renderUsername, resolveMember, resolveUser, trimLines } from "../../../utils.js";
|
||||
import { asyncMap } from "../../../utils/async.js";
|
||||
import { createPaginatedMessage } from "../../../utils/createPaginatedMessage.js";
|
||||
import { getGuildPrefix } from "../../../utils/getGuildPrefix.js";
|
||||
import { CasesPlugin } from "../../Cases/CasesPlugin.js";
|
||||
import { modActionsCmd } from "../types.js";
|
||||
|
||||
const opts = {
|
||||
mod: ct.userId({ option: true }),
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import { APIEmbed, User } from "discord.js";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { CaseTypes } from "../../../data/CaseTypes";
|
||||
import { sendErrorMessage } from "../../../pluginUtils";
|
||||
import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin";
|
||||
import { UnknownUser, chunkArray, emptyEmbedValue, renderUsername, resolveMember, resolveUser } from "../../../utils";
|
||||
import { asyncMap } from "../../../utils/async";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
|
||||
import { CaseTypes } from "../../../data/CaseTypes.js";
|
||||
import { sendErrorMessage } from "../../../pluginUtils.js";
|
||||
import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin.js";
|
||||
import { UnknownUser, chunkArray, emptyEmbedValue, renderUsername, resolveMember, resolveUser } from "../../../utils.js";
|
||||
import { asyncMap } from "../../../utils/async.js";
|
||||
import { createPaginatedMessage } from "../../../utils/createPaginatedMessage.js";
|
||||
import { getGuildPrefix } from "../../../utils/getGuildPrefix";
|
||||
import { modActionsCmd } from "../types";
|
||||
import { getGuildPrefix } from "../../../utils/getGuildPrefix.js";
|
||||
import { modActionsCmd } from "../types.js";
|
||||
|
||||
const opts = {
|
||||
expand: ct.bool({ option: true, isSwitch: true, shortcut: "e" }),
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import { helpers } from "knub";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { Case } from "../../../data/entities/Case";
|
||||
import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { SECONDS, renderUsername, trimLines } from "../../../utils";
|
||||
import { CasesPlugin } from "../../Cases/CasesPlugin";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin";
|
||||
import { modActionsCmd } from "../types";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
|
||||
import { Case } from "../../../data/entities/Case.js";
|
||||
import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js";
|
||||
import { SECONDS, renderUsername, trimLines } from "../../../utils.js";
|
||||
import { CasesPlugin } from "../../Cases/CasesPlugin.js";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin.js";
|
||||
import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin.js";
|
||||
import { modActionsCmd } from "../types.js";
|
||||
|
||||
export const DeleteCaseCmd = modActionsCmd({
|
||||
trigger: ["delete_case", "deletecase"],
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
import { Snowflake } from "discord.js";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { CaseTypes } from "../../../data/CaseTypes";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
import { canActOn, hasPermission, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin";
|
||||
import { DAYS, MINUTES, resolveMember, resolveUser } from "../../../utils";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments";
|
||||
import { ignoreEvent } from "../functions/ignoreEvent";
|
||||
import { isBanned } from "../functions/isBanned";
|
||||
import { IgnoredEventType, modActionsCmd } from "../types";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
|
||||
import { CaseTypes } from "../../../data/CaseTypes.js";
|
||||
import { LogType } from "../../../data/LogType.js";
|
||||
import { canActOn, hasPermission, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js";
|
||||
import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin.js";
|
||||
import { DAYS, MINUTES, resolveMember, resolveUser } from "../../../utils.js";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin.js";
|
||||
import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments.js";
|
||||
import { ignoreEvent } from "../functions/ignoreEvent.js";
|
||||
import { isBanned } from "../functions/isBanned.js";
|
||||
import { IgnoredEventType, modActionsCmd } from "../types.js";
|
||||
|
||||
const opts = {
|
||||
mod: ct.member({ option: true }),
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { canActOn, sendErrorMessage } from "../../../pluginUtils";
|
||||
import { resolveMember, resolveUser } from "../../../utils";
|
||||
import { actualMuteUserCmd } from "../functions/actualMuteUserCmd";
|
||||
import { modActionsCmd } from "../types";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
|
||||
import { canActOn, sendErrorMessage } from "../../../pluginUtils.js";
|
||||
import { resolveMember, resolveUser } from "../../../utils.js";
|
||||
import { actualMuteUserCmd } from "../functions/actualMuteUserCmd.js";
|
||||
import { modActionsCmd } from "../types.js";
|
||||
|
||||
const opts = {
|
||||
mod: ct.member({ option: true }),
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { canActOn, sendErrorMessage } from "../../../pluginUtils";
|
||||
import { resolveMember, resolveUser } from "../../../utils";
|
||||
import { actualUnmuteCmd } from "../functions/actualUnmuteUserCmd";
|
||||
import { modActionsCmd } from "../types";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
|
||||
import { canActOn, sendErrorMessage } from "../../../pluginUtils.js";
|
||||
import { resolveMember, resolveUser } from "../../../utils.js";
|
||||
import { actualUnmuteCmd } from "../functions/actualUnmuteUserCmd.js";
|
||||
import { modActionsCmd } from "../types.js";
|
||||
|
||||
const opts = {
|
||||
mod: ct.member({ option: true }),
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { modActionsCmd } from "../types";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
|
||||
import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js";
|
||||
import { modActionsCmd } from "../types.js";
|
||||
|
||||
export const HideCaseCmd = modActionsCmd({
|
||||
trigger: ["hide", "hidecase", "hide_case"],
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { actualKickMemberCmd } from "../functions/actualKickMemberCmd";
|
||||
import { modActionsCmd } from "../types";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
|
||||
import { actualKickMemberCmd } from "../functions/actualKickMemberCmd.js";
|
||||
import { modActionsCmd } from "../types.js";
|
||||
|
||||
const opts = {
|
||||
mod: ct.member({ option: true }),
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
import { Snowflake } from "discord.js";
|
||||
import { waitForReply } from "knub/helpers";
|
||||
import { performance } from "perf_hooks";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { CaseTypes } from "../../../data/CaseTypes";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
import { humanizeDurationShort } from "../../../humanizeDurationShort";
|
||||
import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin";
|
||||
import { DAYS, MINUTES, SECONDS, noop } from "../../../utils";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments";
|
||||
import { ignoreEvent } from "../functions/ignoreEvent";
|
||||
import { IgnoredEventType, modActionsCmd } from "../types";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
|
||||
import { CaseTypes } from "../../../data/CaseTypes.js";
|
||||
import { LogType } from "../../../data/LogType.js";
|
||||
import { humanizeDurationShort } from "../../../humanizeDurationShort.js";
|
||||
import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js";
|
||||
import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin.js";
|
||||
import { DAYS, MINUTES, SECONDS, noop } from "../../../utils.js";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin.js";
|
||||
import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments.js";
|
||||
import { ignoreEvent } from "../functions/ignoreEvent.js";
|
||||
import { IgnoredEventType, modActionsCmd } from "../types.js";
|
||||
|
||||
export const MassbanCmd = modActionsCmd({
|
||||
trigger: "massban",
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
import { Snowflake } from "discord.js";
|
||||
import { waitForReply } from "knub/helpers";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { CaseTypes } from "../../../data/CaseTypes";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { CasesPlugin } from "../../Cases/CasesPlugin";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments";
|
||||
import { ignoreEvent } from "../functions/ignoreEvent";
|
||||
import { isBanned } from "../functions/isBanned";
|
||||
import { IgnoredEventType, modActionsCmd } from "../types";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
|
||||
import { CaseTypes } from "../../../data/CaseTypes.js";
|
||||
import { LogType } from "../../../data/LogType.js";
|
||||
import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js";
|
||||
import { CasesPlugin } from "../../Cases/CasesPlugin.js";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin.js";
|
||||
import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments.js";
|
||||
import { ignoreEvent } from "../functions/ignoreEvent.js";
|
||||
import { isBanned } from "../functions/isBanned.js";
|
||||
import { IgnoredEventType, modActionsCmd } from "../types.js";
|
||||
|
||||
export const MassunbanCmd = modActionsCmd({
|
||||
trigger: "massunban",
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import { Snowflake } from "discord.js";
|
||||
import { waitForReply } from "knub/helpers";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
import { logger } from "../../../logger";
|
||||
import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { MutesPlugin } from "../../../plugins/Mutes/MutesPlugin";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments";
|
||||
import { modActionsCmd } from "../types";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
|
||||
import { LogType } from "../../../data/LogType.js";
|
||||
import { logger } from "../../../logger.js";
|
||||
import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js";
|
||||
import { MutesPlugin } from "../../../plugins/Mutes/MutesPlugin.js";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin.js";
|
||||
import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments.js";
|
||||
import { modActionsCmd } from "../types.js";
|
||||
|
||||
export const MassmuteCmd = modActionsCmd({
|
||||
trigger: "massmute",
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { canActOn, sendErrorMessage } from "../../../pluginUtils";
|
||||
import { resolveMember, resolveUser } from "../../../utils";
|
||||
import { waitForButtonConfirm } from "../../../utils/waitForInteraction";
|
||||
import { actualMuteUserCmd } from "../functions/actualMuteUserCmd";
|
||||
import { isBanned } from "../functions/isBanned";
|
||||
import { modActionsCmd } from "../types";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
|
||||
import { canActOn, sendErrorMessage } from "../../../pluginUtils.js";
|
||||
import { resolveMember, resolveUser } from "../../../utils.js";
|
||||
import { waitForButtonConfirm } from "../../../utils/waitForInteraction.js";
|
||||
import { actualMuteUserCmd } from "../functions/actualMuteUserCmd.js";
|
||||
import { isBanned } from "../functions/isBanned.js";
|
||||
import { modActionsCmd } from "../types.js";
|
||||
|
||||
const opts = {
|
||||
mod: ct.member({ option: true }),
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { CaseTypes } from "../../../data/CaseTypes";
|
||||
import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { renderUsername, resolveUser } from "../../../utils";
|
||||
import { CasesPlugin } from "../../Cases/CasesPlugin";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments";
|
||||
import { modActionsCmd } from "../types";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
|
||||
import { CaseTypes } from "../../../data/CaseTypes.js";
|
||||
import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js";
|
||||
import { renderUsername, resolveUser } from "../../../utils.js";
|
||||
import { CasesPlugin } from "../../Cases/CasesPlugin.js";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin.js";
|
||||
import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments.js";
|
||||
import { modActionsCmd } from "../types.js";
|
||||
|
||||
export const NoteCmd = modActionsCmd({
|
||||
trigger: "note",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { trimPluginDescription } from "../../../utils";
|
||||
import { actualKickMemberCmd } from "../functions/actualKickMemberCmd";
|
||||
import { modActionsCmd } from "../types";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
|
||||
import { trimPluginDescription } from "../../../utils.js";
|
||||
import { actualKickMemberCmd } from "../functions/actualKickMemberCmd.js";
|
||||
import { modActionsCmd } from "../types.js";
|
||||
|
||||
const opts = {
|
||||
mod: ct.member({ option: true }),
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
import { Snowflake } from "discord.js";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { CaseTypes } from "../../../data/CaseTypes";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
import { clearExpiringTempban } from "../../../data/loops/expiringTempbansLoop";
|
||||
import { hasPermission, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin";
|
||||
import { resolveUser } from "../../../utils";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments";
|
||||
import { ignoreEvent } from "../functions/ignoreEvent";
|
||||
import { IgnoredEventType, modActionsCmd } from "../types";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
|
||||
import { CaseTypes } from "../../../data/CaseTypes.js";
|
||||
import { LogType } from "../../../data/LogType.js";
|
||||
import { clearExpiringTempban } from "../../../data/loops/expiringTempbansLoop.js";
|
||||
import { hasPermission, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js";
|
||||
import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin.js";
|
||||
import { resolveUser } from "../../../utils.js";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin.js";
|
||||
import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments.js";
|
||||
import { ignoreEvent } from "../functions/ignoreEvent.js";
|
||||
import { IgnoredEventType, modActionsCmd } from "../types.js";
|
||||
|
||||
const opts = {
|
||||
mod: ct.member({ option: true }),
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { modActionsCmd } from "../types";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
|
||||
import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js";
|
||||
import { modActionsCmd } from "../types.js";
|
||||
|
||||
export const UnhideCaseCmd = modActionsCmd({
|
||||
trigger: ["unhide", "unhidecase", "unhide_case"],
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { MutesPlugin } from "../../../plugins/Mutes/MutesPlugin";
|
||||
import { canActOn, sendErrorMessage } from "../../../pluginUtils";
|
||||
import { resolveMember, resolveUser } from "../../../utils";
|
||||
import { waitForButtonConfirm } from "../../../utils/waitForInteraction";
|
||||
import { actualUnmuteCmd } from "../functions/actualUnmuteUserCmd";
|
||||
import { isBanned } from "../functions/isBanned";
|
||||
import { modActionsCmd } from "../types";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
|
||||
import { MutesPlugin } from "../../../plugins/Mutes/MutesPlugin.js";
|
||||
import { canActOn, sendErrorMessage } from "../../../pluginUtils.js";
|
||||
import { resolveMember, resolveUser } from "../../../utils.js";
|
||||
import { waitForButtonConfirm } from "../../../utils/waitForInteraction.js";
|
||||
import { actualUnmuteCmd } from "../functions/actualUnmuteUserCmd.js";
|
||||
import { isBanned } from "../functions/isBanned.js";
|
||||
import { modActionsCmd } from "../types.js";
|
||||
|
||||
const opts = {
|
||||
mod: ct.member({ option: true }),
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { updateCase } from "../functions/updateCase";
|
||||
import { modActionsCmd } from "../types";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
|
||||
import { updateCase } from "../functions/updateCase.js";
|
||||
import { modActionsCmd } from "../types.js";
|
||||
|
||||
export const UpdateCmd = modActionsCmd({
|
||||
trigger: ["update", "reason"],
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { CaseTypes } from "../../../data/CaseTypes";
|
||||
import { canActOn, hasPermission, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { errorMessage, renderUsername, resolveMember, resolveUser } from "../../../utils";
|
||||
import { waitForButtonConfirm } from "../../../utils/waitForInteraction";
|
||||
import { CasesPlugin } from "../../Cases/CasesPlugin";
|
||||
import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments";
|
||||
import { isBanned } from "../functions/isBanned";
|
||||
import { readContactMethodsFromArgs } from "../functions/readContactMethodsFromArgs";
|
||||
import { warnMember } from "../functions/warnMember";
|
||||
import { modActionsCmd } from "../types";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
|
||||
import { CaseTypes } from "../../../data/CaseTypes.js";
|
||||
import { canActOn, hasPermission, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js";
|
||||
import { errorMessage, renderUsername, resolveMember, resolveUser } from "../../../utils.js";
|
||||
import { waitForButtonConfirm } from "../../../utils/waitForInteraction.js";
|
||||
import { CasesPlugin } from "../../Cases/CasesPlugin.js";
|
||||
import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments.js";
|
||||
import { isBanned } from "../functions/isBanned.js";
|
||||
import { readContactMethodsFromArgs } from "../functions/readContactMethodsFromArgs.js";
|
||||
import { warnMember } from "../functions/warnMember.js";
|
||||
import { modActionsCmd } from "../types.js";
|
||||
|
||||
export const WarnCmd = modActionsCmd({
|
||||
trigger: "warn",
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { AuditLogChange, AuditLogEvent } from "discord.js";
|
||||
import moment from "moment-timezone";
|
||||
import { CaseTypes } from "../../../data/CaseTypes";
|
||||
import { resolveUser } from "../../../utils";
|
||||
import { CasesPlugin } from "../../Cases/CasesPlugin";
|
||||
import { modActionsEvt } from "../types";
|
||||
import { CaseTypes } from "../../../data/CaseTypes.js";
|
||||
import { resolveUser } from "../../../utils.js";
|
||||
import { CasesPlugin } from "../../Cases/CasesPlugin.js";
|
||||
import { modActionsEvt } from "../types.js";
|
||||
|
||||
export const AuditLogEvents = modActionsEvt({
|
||||
event: "guildAuditLogEntryCreate",
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
import { AuditLogEvent, User } from "discord.js";
|
||||
import { CaseTypes } from "../../../data/CaseTypes";
|
||||
import { Case } from "../../../data/entities/Case";
|
||||
import { UnknownUser, resolveUser } from "../../../utils";
|
||||
import { findMatchingAuditLogEntry } from "../../../utils/findMatchingAuditLogEntry";
|
||||
import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects";
|
||||
import { CasesPlugin } from "../../Cases/CasesPlugin";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { clearIgnoredEvents } from "../functions/clearIgnoredEvents";
|
||||
import { isEventIgnored } from "../functions/isEventIgnored";
|
||||
import { IgnoredEventType, modActionsEvt } from "../types";
|
||||
import { CaseTypes } from "../../../data/CaseTypes.js";
|
||||
import { Case } from "../../../data/entities/Case.js";
|
||||
import { UnknownUser, resolveUser } from "../../../utils.js";
|
||||
import { findMatchingAuditLogEntry } from "../../../utils/findMatchingAuditLogEntry.js";
|
||||
import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects.js";
|
||||
import { CasesPlugin } from "../../Cases/CasesPlugin.js";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin.js";
|
||||
import { clearIgnoredEvents } from "../functions/clearIgnoredEvents.js";
|
||||
import { isEventIgnored } from "../functions/isEventIgnored.js";
|
||||
import { IgnoredEventType, modActionsEvt } from "../types.js";
|
||||
|
||||
/**
|
||||
* Create a BAN case automatically when a user is banned manually.
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
import { AuditLogEvent, User } from "discord.js";
|
||||
import { CaseTypes } from "../../../data/CaseTypes";
|
||||
import { Case } from "../../../data/entities/Case";
|
||||
import { logger } from "../../../logger";
|
||||
import { UnknownUser, resolveUser } from "../../../utils";
|
||||
import { findMatchingAuditLogEntry } from "../../../utils/findMatchingAuditLogEntry";
|
||||
import { CasesPlugin } from "../../Cases/CasesPlugin";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { clearIgnoredEvents } from "../functions/clearIgnoredEvents";
|
||||
import { isEventIgnored } from "../functions/isEventIgnored";
|
||||
import { IgnoredEventType, modActionsEvt } from "../types";
|
||||
import { CaseTypes } from "../../../data/CaseTypes.js";
|
||||
import { Case } from "../../../data/entities/Case.js";
|
||||
import { logger } from "../../../logger.js";
|
||||
import { UnknownUser, resolveUser } from "../../../utils.js";
|
||||
import { findMatchingAuditLogEntry } from "../../../utils/findMatchingAuditLogEntry.js";
|
||||
import { CasesPlugin } from "../../Cases/CasesPlugin.js";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin.js";
|
||||
import { clearIgnoredEvents } from "../functions/clearIgnoredEvents.js";
|
||||
import { isEventIgnored } from "../functions/isEventIgnored.js";
|
||||
import { IgnoredEventType, modActionsEvt } from "../types.js";
|
||||
|
||||
/**
|
||||
* Create a KICK case automatically when a user is kicked manually.
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import { AuditLogEvent, User } from "discord.js";
|
||||
import { CaseTypes } from "../../../data/CaseTypes";
|
||||
import { Case } from "../../../data/entities/Case";
|
||||
import { UnknownUser, resolveUser } from "../../../utils";
|
||||
import { findMatchingAuditLogEntry } from "../../../utils/findMatchingAuditLogEntry";
|
||||
import { CasesPlugin } from "../../Cases/CasesPlugin";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { clearIgnoredEvents } from "../functions/clearIgnoredEvents";
|
||||
import { isEventIgnored } from "../functions/isEventIgnored";
|
||||
import { IgnoredEventType, modActionsEvt } from "../types";
|
||||
import { CaseTypes } from "../../../data/CaseTypes.js";
|
||||
import { Case } from "../../../data/entities/Case.js";
|
||||
import { UnknownUser, resolveUser } from "../../../utils.js";
|
||||
import { findMatchingAuditLogEntry } from "../../../utils/findMatchingAuditLogEntry.js";
|
||||
import { CasesPlugin } from "../../Cases/CasesPlugin.js";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin.js";
|
||||
import { clearIgnoredEvents } from "../functions/clearIgnoredEvents.js";
|
||||
import { isEventIgnored } from "../functions/isEventIgnored.js";
|
||||
import { IgnoredEventType, modActionsEvt } from "../types.js";
|
||||
|
||||
/**
|
||||
* Create an UNBAN case automatically when a user is unbanned manually.
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { PermissionsBitField, Snowflake, TextChannel } from "discord.js";
|
||||
import { renderUsername, resolveMember } from "../../../utils";
|
||||
import { hasDiscordPermissions } from "../../../utils/hasDiscordPermissions";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { modActionsEvt } from "../types";
|
||||
import { renderUsername, resolveMember } from "../../../utils.js";
|
||||
import { hasDiscordPermissions } from "../../../utils/hasDiscordPermissions.js";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin.js";
|
||||
import { modActionsEvt } from "../types.js";
|
||||
|
||||
/**
|
||||
* Show an alert if a member with prior notes joins the server
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
import { GuildMember, GuildTextBasedChannel } from "discord.js";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { hasPermission } from "knub/helpers";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { DAYS, SECONDS, errorMessage, renderUsername, resolveMember, resolveUser } from "../../../utils";
|
||||
import { IgnoredEventType, ModActionsPluginType } from "../types";
|
||||
import { formatReasonWithAttachments } from "./formatReasonWithAttachments";
|
||||
import { ignoreEvent } from "./ignoreEvent";
|
||||
import { isBanned } from "./isBanned";
|
||||
import { kickMember } from "./kickMember";
|
||||
import { readContactMethodsFromArgs } from "./readContactMethodsFromArgs";
|
||||
import { LogType } from "../../../data/LogType.js";
|
||||
import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js";
|
||||
import { DAYS, SECONDS, errorMessage, renderUsername, resolveMember, resolveUser } from "../../../utils.js";
|
||||
import { IgnoredEventType, ModActionsPluginType } from "../types.js";
|
||||
import { formatReasonWithAttachments } from "./formatReasonWithAttachments.js";
|
||||
import { ignoreEvent } from "./ignoreEvent.js";
|
||||
import { isBanned } from "./isBanned.js";
|
||||
import { kickMember } from "./kickMember.js";
|
||||
import { readContactMethodsFromArgs } from "./readContactMethodsFromArgs.js";
|
||||
|
||||
export async function actualKickMemberCmd(
|
||||
pluginData: GuildPluginData<ModActionsPluginType>,
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
import { GuildMember, GuildTextBasedChannel, Message, User } from "discord.js";
|
||||
import humanizeDuration from "humanize-duration";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { ERRORS, RecoverablePluginError } from "../../../RecoverablePluginError";
|
||||
import { logger } from "../../../logger";
|
||||
import { hasPermission, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { UnknownUser, asSingleLine, isDiscordAPIError, renderUsername } from "../../../utils";
|
||||
import { MutesPlugin } from "../../Mutes/MutesPlugin";
|
||||
import { MuteResult } from "../../Mutes/types";
|
||||
import { ModActionsPluginType } from "../types";
|
||||
import { formatReasonWithAttachments } from "./formatReasonWithAttachments";
|
||||
import { readContactMethodsFromArgs } from "./readContactMethodsFromArgs";
|
||||
import { ERRORS, RecoverablePluginError } from "../../../RecoverablePluginError.js";
|
||||
import { logger } from "../../../logger.js";
|
||||
import { hasPermission, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js";
|
||||
import { UnknownUser, asSingleLine, isDiscordAPIError, renderUsername } from "../../../utils.js";
|
||||
import { MutesPlugin } from "../../Mutes/MutesPlugin.js";
|
||||
import { MuteResult } from "../../Mutes/types.js";
|
||||
import { ModActionsPluginType } from "../types.js";
|
||||
import { formatReasonWithAttachments } from "./formatReasonWithAttachments.js";
|
||||
import { readContactMethodsFromArgs } from "./readContactMethodsFromArgs.js";
|
||||
|
||||
/**
|
||||
* The actual function run by both !mute and !forcemute.
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { GuildMember, Message, User } from "discord.js";
|
||||
import humanizeDuration from "humanize-duration";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { hasPermission, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { MutesPlugin } from "../../../plugins/Mutes/MutesPlugin";
|
||||
import { UnknownUser, asSingleLine, renderUsername } from "../../../utils";
|
||||
import { ModActionsPluginType } from "../types";
|
||||
import { formatReasonWithAttachments } from "./formatReasonWithAttachments";
|
||||
import { hasPermission, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js";
|
||||
import { MutesPlugin } from "../../../plugins/Mutes/MutesPlugin.js";
|
||||
import { UnknownUser, asSingleLine, renderUsername } from "../../../utils.js";
|
||||
import { ModActionsPluginType } from "../types.js";
|
||||
import { formatReasonWithAttachments } from "./formatReasonWithAttachments.js";
|
||||
|
||||
export async function actualUnmuteCmd(
|
||||
pluginData: GuildPluginData<ModActionsPluginType>,
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { DiscordAPIError, Snowflake } from "discord.js";
|
||||
import humanizeDuration from "humanize-duration";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { CaseTypes } from "../../../data/CaseTypes";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
import { registerExpiringTempban } from "../../../data/loops/expiringTempbansLoop";
|
||||
import { logger } from "../../../logger";
|
||||
import { TemplateParseError, TemplateSafeValueContainer, renderTemplate } from "../../../templateFormatter";
|
||||
import { CaseTypes } from "../../../data/CaseTypes.js";
|
||||
import { LogType } from "../../../data/LogType.js";
|
||||
import { registerExpiringTempban } from "../../../data/loops/expiringTempbansLoop.js";
|
||||
import { logger } from "../../../logger.js";
|
||||
import { TemplateParseError, TemplateSafeValueContainer, renderTemplate } from "../../../templateFormatter.js";
|
||||
import {
|
||||
DAYS,
|
||||
SECONDS,
|
||||
|
@ -15,13 +15,13 @@ import {
|
|||
resolveMember,
|
||||
resolveUser,
|
||||
ucfirst,
|
||||
} from "../../../utils";
|
||||
import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects";
|
||||
import { CasesPlugin } from "../../Cases/CasesPlugin";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { BanOptions, BanResult, IgnoredEventType, ModActionsPluginType } from "../types";
|
||||
import { getDefaultContactMethods } from "./getDefaultContactMethods";
|
||||
import { ignoreEvent } from "./ignoreEvent";
|
||||
} from "../../../utils.js";
|
||||
import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects.js";
|
||||
import { CasesPlugin } from "../../Cases/CasesPlugin.js";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin.js";
|
||||
import { BanOptions, BanResult, IgnoredEventType, ModActionsPluginType } from "../types.js";
|
||||
import { getDefaultContactMethods } from "./getDefaultContactMethods.js";
|
||||
import { ignoreEvent } from "./ignoreEvent.js";
|
||||
|
||||
/**
|
||||
* Ban the specified user id, whether or not they're actually on the server at the time. Generates a case.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import { IgnoredEventType, ModActionsPluginType } from "../types";
|
||||
import { IgnoredEventType, ModActionsPluginType } from "../types.js";
|
||||
|
||||
export function clearIgnoredEvents(
|
||||
pluginData: GuildPluginData<ModActionsPluginType>,
|
||||
|
|
|
@ -2,17 +2,17 @@ import { Snowflake } from "discord.js";
|
|||
import humanizeDuration from "humanize-duration";
|
||||
import { GuildPluginData } from "knub";
|
||||
import moment from "moment-timezone";
|
||||
import { CaseTypes } from "../../../data/CaseTypes";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
import { Tempban } from "../../../data/entities/Tempban";
|
||||
import { logger } from "../../../logger";
|
||||
import { resolveUser } from "../../../utils";
|
||||
import { CasesPlugin } from "../../Cases/CasesPlugin";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { IgnoredEventType, ModActionsPluginType } from "../types";
|
||||
import { formatReasonWithAttachments } from "./formatReasonWithAttachments";
|
||||
import { ignoreEvent } from "./ignoreEvent";
|
||||
import { isBanned } from "./isBanned";
|
||||
import { CaseTypes } from "../../../data/CaseTypes.js";
|
||||
import { LogType } from "../../../data/LogType.js";
|
||||
import { Tempban } from "../../../data/entities/Tempban.js";
|
||||
import { logger } from "../../../logger.js";
|
||||
import { resolveUser } from "../../../utils.js";
|
||||
import { CasesPlugin } from "../../Cases/CasesPlugin.js";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin.js";
|
||||
import { IgnoredEventType, ModActionsPluginType } from "../types.js";
|
||||
import { formatReasonWithAttachments } from "./formatReasonWithAttachments.js";
|
||||
import { ignoreEvent } from "./ignoreEvent.js";
|
||||
import { isBanned } from "./isBanned.js";
|
||||
|
||||
export async function clearTempban(pluginData: GuildPluginData<ModActionsPluginType>, tempban: Tempban) {
|
||||
if (!(await isBanned(pluginData, tempban.user_id))) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { Snowflake, TextChannel } from "discord.js";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { UserNotificationMethod } from "../../../utils";
|
||||
import { ModActionsPluginType } from "../types";
|
||||
import { UserNotificationMethod } from "../../../utils.js";
|
||||
import { ModActionsPluginType } from "../types.js";
|
||||
|
||||
export function getDefaultContactMethods(
|
||||
pluginData: GuildPluginData<ModActionsPluginType>,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { GuildMember, Snowflake } from "discord.js";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { ModActionsPluginType } from "../types";
|
||||
import { ModActionsPluginType } from "../types.js";
|
||||
|
||||
export async function hasMutePermission(
|
||||
pluginData: GuildPluginData<ModActionsPluginType>,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import { SECONDS } from "../../../utils";
|
||||
import { IgnoredEventType, ModActionsPluginType } from "../types";
|
||||
import { clearIgnoredEvents } from "./clearIgnoredEvents";
|
||||
import { SECONDS } from "../../../utils.js";
|
||||
import { IgnoredEventType, ModActionsPluginType } from "../types.js";
|
||||
import { clearIgnoredEvents } from "./clearIgnoredEvents.js";
|
||||
|
||||
const DEFAULT_TIMEOUT = 15 * SECONDS;
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { PermissionsBitField, Snowflake } from "discord.js";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { SECONDS, isDiscordAPIError, isDiscordHTTPError, sleep } from "../../../utils";
|
||||
import { hasDiscordPermissions } from "../../../utils/hasDiscordPermissions";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { ModActionsPluginType } from "../types";
|
||||
import { SECONDS, isDiscordAPIError, isDiscordHTTPError, sleep } from "../../../utils.js";
|
||||
import { hasDiscordPermissions } from "../../../utils/hasDiscordPermissions.js";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin.js";
|
||||
import { ModActionsPluginType } from "../types.js";
|
||||
|
||||
export async function isBanned(
|
||||
pluginData: GuildPluginData<ModActionsPluginType>,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import { IgnoredEventType, ModActionsPluginType } from "../types";
|
||||
import { IgnoredEventType, ModActionsPluginType } from "../types.js";
|
||||
|
||||
export function isEventIgnored(
|
||||
pluginData: GuildPluginData<ModActionsPluginType>,
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
import { GuildMember } from "discord.js";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { CaseTypes } from "../../../data/CaseTypes";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
import { renderTemplate, TemplateParseError, TemplateSafeValueContainer } from "../../../templateFormatter";
|
||||
import { createUserNotificationError, notifyUser, resolveUser, ucfirst, UserNotificationResult } from "../../../utils";
|
||||
import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects";
|
||||
import { CasesPlugin } from "../../Cases/CasesPlugin";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { IgnoredEventType, KickOptions, KickResult, ModActionsPluginType } from "../types";
|
||||
import { getDefaultContactMethods } from "./getDefaultContactMethods";
|
||||
import { ignoreEvent } from "./ignoreEvent";
|
||||
import { CaseTypes } from "../../../data/CaseTypes.js";
|
||||
import { LogType } from "../../../data/LogType.js";
|
||||
import { renderTemplate, TemplateParseError, TemplateSafeValueContainer } from "../../../templateFormatter.js";
|
||||
import { createUserNotificationError, notifyUser, resolveUser, ucfirst, UserNotificationResult } from "../../../utils.js";
|
||||
import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects.js";
|
||||
import { CasesPlugin } from "../../Cases/CasesPlugin.js";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin.js";
|
||||
import { IgnoredEventType, KickOptions, KickResult, ModActionsPluginType } from "../types.js";
|
||||
import { getDefaultContactMethods } from "./getDefaultContactMethods.js";
|
||||
import { ignoreEvent } from "./ignoreEvent.js";
|
||||
|
||||
/**
|
||||
* Kick the specified server member. Generates a case.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import { ModActionsEvents, ModActionsPluginType } from "../types";
|
||||
import { ModActionsEvents, ModActionsPluginType } from "../types.js";
|
||||
|
||||
export function offModActionsEvent<TEvent extends keyof ModActionsEvents>(
|
||||
pluginData: GuildPluginData<ModActionsPluginType>,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import { ModActionsEvents, ModActionsPluginType } from "../types";
|
||||
import { ModActionsEvents, ModActionsPluginType } from "../types.js";
|
||||
|
||||
export function onModActionsEvent<TEvent extends keyof ModActionsEvents>(
|
||||
pluginData: GuildPluginData<ModActionsPluginType>,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { GuildTextBasedChannel } from "discord.js";
|
||||
import { disableUserNotificationStrings, UserNotificationMethod } from "../../../utils";
|
||||
import { disableUserNotificationStrings, UserNotificationMethod } from "../../../utils.js";
|
||||
|
||||
export function readContactMethodsFromArgs(args: {
|
||||
notify?: string;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { Message } from "discord.js";
|
||||
import { CaseTypes } from "../../../data/CaseTypes";
|
||||
import { Case } from "../../../data/entities/Case";
|
||||
import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { formatReasonWithAttachments } from "./formatReasonWithAttachments";
|
||||
import { CaseTypes } from "../../../data/CaseTypes.js";
|
||||
import { Case } from "../../../data/entities/Case.js";
|
||||
import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils.js";
|
||||
import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin.js";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin.js";
|
||||
import { formatReasonWithAttachments } from "./formatReasonWithAttachments.js";
|
||||
|
||||
export async function updateCase(pluginData, msg: Message, args) {
|
||||
let theCase: Case | undefined;
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
import { GuildMember, Snowflake } from "discord.js";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { CaseTypes } from "../../../data/CaseTypes";
|
||||
import { TemplateParseError, TemplateSafeValueContainer, renderTemplate } from "../../../templateFormatter";
|
||||
import { UserNotificationResult, createUserNotificationError, notifyUser, resolveUser, ucfirst } from "../../../utils";
|
||||
import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects";
|
||||
import { waitForButtonConfirm } from "../../../utils/waitForInteraction";
|
||||
import { CasesPlugin } from "../../Cases/CasesPlugin";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { ModActionsPluginType, WarnOptions, WarnResult } from "../types";
|
||||
import { getDefaultContactMethods } from "./getDefaultContactMethods";
|
||||
import { CaseTypes } from "../../../data/CaseTypes.js";
|
||||
import { TemplateParseError, TemplateSafeValueContainer, renderTemplate } from "../../../templateFormatter.js";
|
||||
import { UserNotificationResult, createUserNotificationError, notifyUser, resolveUser, ucfirst } from "../../../utils.js";
|
||||
import { userToTemplateSafeUser } from "../../../utils/templateSafeObjects.js";
|
||||
import { waitForButtonConfirm } from "../../../utils/waitForInteraction.js";
|
||||
import { CasesPlugin } from "../../Cases/CasesPlugin.js";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin.js";
|
||||
import { ModActionsPluginType, WarnOptions, WarnResult } from "../types.js";
|
||||
import { getDefaultContactMethods } from "./getDefaultContactMethods.js";
|
||||
|
||||
export async function warnMember(
|
||||
pluginData: GuildPluginData<ModActionsPluginType>,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { ZeppelinPluginInfo } from "../../types";
|
||||
import { trimPluginDescription } from "../../utils";
|
||||
import { zModActionsConfig } from "./types";
|
||||
import { ZeppelinPluginInfo } from "../../types.js";
|
||||
import { trimPluginDescription } from "../../utils.js";
|
||||
import { zModActionsConfig } from "./types.js";
|
||||
|
||||
export const modActionsPluginInfo: ZeppelinPluginInfo = {
|
||||
prettyName: "Mod actions",
|
||||
|
|
|
@ -2,14 +2,14 @@ import { GuildTextBasedChannel } from "discord.js";
|
|||
import { EventEmitter } from "events";
|
||||
import { BasePluginType, guildPluginEventListener, guildPluginMessageCommand } from "knub";
|
||||
import z from "zod";
|
||||
import { Queue } from "../../Queue";
|
||||
import { GuildCases } from "../../data/GuildCases";
|
||||
import { GuildLogs } from "../../data/GuildLogs";
|
||||
import { GuildMutes } from "../../data/GuildMutes";
|
||||
import { GuildTempbans } from "../../data/GuildTempbans";
|
||||
import { Case } from "../../data/entities/Case";
|
||||
import { UserNotificationMethod, UserNotificationResult } from "../../utils";
|
||||
import { CaseArgs } from "../Cases/types";
|
||||
import { Queue } from "../../Queue.js";
|
||||
import { GuildCases } from "../../data/GuildCases.js";
|
||||
import { GuildLogs } from "../../data/GuildLogs.js";
|
||||
import { GuildMutes } from "../../data/GuildMutes.js";
|
||||
import { GuildTempbans } from "../../data/GuildTempbans.js";
|
||||
import { Case } from "../../data/entities/Case.js";
|
||||
import { UserNotificationMethod, UserNotificationResult } from "../../utils.js";
|
||||
import { CaseArgs } from "../Cases/types.js";
|
||||
|
||||
export const zModActionsConfig = z.strictObject({
|
||||
dm_on_warn: z.boolean(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue