3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 12:25:02 +00:00

Organise all imports, make Mutes depend on Logs

This commit is contained in:
Dark 2021-06-06 23:51:32 +02:00
parent a94e7593ec
commit 6ac9d2f2a2
No known key found for this signature in database
GPG key ID: 2CD6ACB6B0A87B8A
437 changed files with 1912 additions and 2027 deletions

View file

@ -1,51 +1,51 @@
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
import { CasesPlugin } from "../Cases/CasesPlugin";
import { MutesPlugin } from "../Mutes/MutesPlugin";
import { BanOptions, ConfigSchema, KickOptions, ModActionsPluginType, WarnOptions } from "./types";
import { CreateBanCaseOnManualBanEvt } from "./events/CreateBanCaseOnManualBanEvt";
import { CreateUnbanCaseOnManualUnbanEvt } from "./events/CreateUnbanCaseOnManualUnbanEvt";
import { CreateKickCaseOnManualKickEvt } from "./events/CreateKickCaseOnManualKickEvt";
import { UpdateCmd } from "./commands/UpdateCmd";
import { NoteCmd } from "./commands/NoteCmd";
import { WarnCmd } from "./commands/WarnCmd";
import { MuteCmd } from "./commands/MuteCmd";
import { PostAlertOnMemberJoinEvt } from "./events/PostAlertOnMemberJoinEvt";
import { ForcemuteCmd } from "./commands/ForcemuteCmd";
import { UnmuteCmd } from "./commands/UnmuteCmd";
import { KickCmd } from "./commands/KickCmd";
import { SoftbanCmd } from "./commands/SoftbanCommand";
import { BanCmd } from "./commands/BanCmd";
import { UnbanCmd } from "./commands/UnbanCmd";
import { ForcebanCmd } from "./commands/ForcebanCmd";
import { MassunbanCmd } from "./commands/MassUnbanCmd";
import { MassbanCmd } from "./commands/MassBanCmd";
import { AddCaseCmd } from "./commands/AddCaseCmd";
import { CaseCmd } from "./commands/CaseCmd";
import { CasesUserCmd } from "./commands/CasesUserCmd";
import { CasesModCmd } from "./commands/CasesModCmd";
import { HideCaseCmd } from "./commands/HideCaseCmd";
import { UnhideCaseCmd } from "./commands/UnhideCaseCmd";
import { GuildMutes } from "../../data/GuildMutes";
import { GuildMember, Message } from "discord.js";
import { EventEmitter } from "events";
import { GuildCases } from "../../data/GuildCases";
import { GuildLogs } from "../../data/GuildLogs";
import { ForceUnmuteCmd } from "./commands/ForceunmuteCmd";
import { warnMember } from "./functions/warnMember";
import { kickMember } from "./functions/kickMember";
import { banUserId } from "./functions/banUserId";
import { MassmuteCmd } from "./commands/MassmuteCmd";
import { MINUTES, trimPluginDescription } from "../../utils";
import { DeleteCaseCmd } from "./commands/DeleteCaseCmd";
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
import { GuildMutes } from "../../data/GuildMutes";
import { GuildTempbans } from "../../data/GuildTempbans";
import { outdatedTempbansLoop } from "./functions/outdatedTempbansLoop";
import { EventEmitter } from "events";
import { mapToPublicFn } from "../../pluginUtils";
import { onModActionsEvent } from "./functions/onModActionsEvent";
import { offModActionsEvent } from "./functions/offModActionsEvent";
import { updateCase } from "./functions/updateCase";
import { Queue } from "../../Queue";
import { GuildMember, Message } from "discord.js";
import { MINUTES, trimPluginDescription } from "../../utils";
import { CasesPlugin } from "../Cases/CasesPlugin";
import { MutesPlugin } from "../Mutes/MutesPlugin";
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
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 { MassmuteCmd } from "./commands/MassmuteCmd";
import { MassunbanCmd } from "./commands/MassUnbanCmd";
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 { CreateBanCaseOnManualBanEvt } from "./events/CreateBanCaseOnManualBanEvt";
import { CreateKickCaseOnManualKickEvt } from "./events/CreateKickCaseOnManualKickEvt";
import { CreateUnbanCaseOnManualUnbanEvt } from "./events/CreateUnbanCaseOnManualUnbanEvt";
import { PostAlertOnMemberJoinEvt } from "./events/PostAlertOnMemberJoinEvt";
import { banUserId } from "./functions/banUserId";
import { kickMember } from "./functions/kickMember";
import { offModActionsEvent } from "./functions/offModActionsEvent";
import { onModActionsEvent } from "./functions/onModActionsEvent";
import { outdatedTempbansLoop } from "./functions/outdatedTempbansLoop";
import { updateCase } from "./functions/updateCase";
import { warnMember } from "./functions/warnMember";
import { BanOptions, ConfigSchema, KickOptions, ModActionsPluginType, WarnOptions } from "./types";
const defaultOptions = {
config: {

View file

@ -1,12 +1,12 @@
import { modActionsCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { canActOn, sendErrorMessage, hasPermission, sendSuccessMessage } from "../../../pluginUtils";
import { resolveUser, resolveMember, stripObjectToScalars } from "../../../utils";
import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments";
import { CaseTypes } from "../../../data/CaseTypes";
import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin";
import { Case } from "../../../data/entities/Case";
import { LogType } from "../../../data/LogType";
import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin";
import { canActOn, hasPermission, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
import { resolveMember, resolveUser, stripObjectToScalars } from "../../../utils";
import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments";
import { modActionsCmd } from "../types";
const opts = {
mod: ct.member({ option: true }),

View file

@ -1,18 +1,18 @@
import { modActionsCmd, IgnoredEventType } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { canActOn, sendErrorMessage, hasPermission, sendSuccessMessage } from "../../../pluginUtils";
import { resolveUser, resolveMember, stripObjectToScalars, noop } from "../../../utils";
import { isBanned } from "../functions/isBanned";
import { readContactMethodsFromArgs } from "../functions/readContactMethodsFromArgs";
import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments";
import { banUserId } from "../functions/banUserId";
import { getMemberLevel } from "knub/dist/helpers";
import humanizeDuration from "humanize-duration";
import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin";
import { getMemberLevel } from "knub/dist/helpers";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { CaseTypes } from "../../../data/CaseTypes";
import { LogType } from "../../../data/LogType";
import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin";
import { canActOn, hasPermission, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
import { resolveMember, resolveUser, stripObjectToScalars } from "../../../utils";
import { banLock } from "../../../utils/lockNameHelpers";
import { waitForButtonConfirm } from "../../../utils/waitForInteraction";
import { banUserId } from "../functions/banUserId";
import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments";
import { isBanned } from "../functions/isBanned";
import { readContactMethodsFromArgs } from "../functions/readContactMethodsFromArgs";
import { modActionsCmd } from "../types";
const opts = {
mod: ct.member({ option: true }),

View file

@ -1,7 +1,7 @@
import { modActionsCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { sendErrorMessage } from "../../../pluginUtils";
import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin";
import { sendErrorMessage } from "../../../pluginUtils";
import { modActionsCmd } from "../types";
export const CaseCmd = modActionsCmd({
trigger: "case",

View file

@ -1,15 +1,14 @@
import { modActionsCmd } from "../types";
import { MessageEmbedOptions, User } from "discord.js";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { sendErrorMessage } from "../../../pluginUtils";
import { trimLines, createChunkedMessage, emptyEmbedValue, sorter, resolveUser } from "../../../utils";
import { CasesPlugin } from "../../Cases/CasesPlugin";
import { emptyEmbedValue, resolveUser, trimLines } from "../../../utils";
import { asyncMap } from "../../../utils/async";
import { getChunkedEmbedFields } from "../../../utils/getChunkedEmbedFields";
import { getDefaultPrefix } from "knub/dist/commands/commandUtils";
import { getGuildPrefix } from "../../../utils/getGuildPrefix";
import { createPaginatedMessage } from "../../../utils/createPaginatedMessage";
import { MessageEmbedOptions, User } from "discord.js";
import { getChunkedEmbedFields } from "../../../utils/getChunkedEmbedFields";
import { getGuildPrefix } from "../../../utils/getGuildPrefix";
import { CasesPlugin } from "../../Cases/CasesPlugin";
import { modActionsCmd } from "../types";
const opts = {
mod: ct.userId({ option: true }),

View file

@ -1,22 +1,16 @@
import { modActionsCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { sendErrorMessage } from "../../../pluginUtils";
import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin";
import {
UnknownUser,
multiSorter,
trimLines,
createChunkedMessage,
resolveUser,
emptyEmbedValue,
chunkArray,
} from "../../../utils";
import { getGuildPrefix } from "../../../utils/getGuildPrefix";
import { getChunkedEmbedFields } from "../../../utils/getChunkedEmbedFields";
import { asyncMap } from "../../../utils/async";
import { CaseTypes } from "../../../data/CaseTypes";
import { MessageEmbedOptions, User } from "discord.js";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { CaseTypes } from "../../../data/CaseTypes";
import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin";
import { sendErrorMessage } from "../../../pluginUtils";
import {
chunkArray, emptyEmbedValue, resolveUser, trimLines, UnknownUser
} from "../../../utils";
import { asyncMap } from "../../../utils/async";
import { getChunkedEmbedFields } from "../../../utils/getChunkedEmbedFields";
import { getGuildPrefix } from "../../../utils/getGuildPrefix";
import { modActionsCmd } from "../types";
const opts = {
expand: ct.bool({ option: true, isSwitch: true, shortcut: "e" }),

View file

@ -1,16 +1,15 @@
import { modActionsCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
import { helpers } from "knub";
import { CasesPlugin } from "../../Cases/CasesPlugin";
import { SECONDS, stripObjectToScalars, trimLines } from "../../../utils";
import { LogsPlugin } from "../../Logs/LogsPlugin";
import { LogType } from "../../../data/LogType";
import moment from "moment-timezone";
import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin";
import { Case } from "../../../data/entities/Case";
import { TextChannel } from "discord.js";
import { helpers } from "knub";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { Case } from "../../../data/entities/Case";
import { LogType } from "../../../data/LogType";
import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
import { SECONDS, stripObjectToScalars, trimLines } from "../../../utils";
import { CasesPlugin } from "../../Cases/CasesPlugin";
import { LogsPlugin } from "../../Logs/LogsPlugin";
import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin";
import { modActionsCmd } from "../types";
export const DeleteCaseCmd = modActionsCmd({
trigger: ["delete_case", "deletecase"],

View file

@ -1,15 +1,13 @@
import { modActionsCmd, IgnoredEventType } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { canActOn, sendErrorMessage, hasPermission, sendSuccessMessage } from "../../../pluginUtils";
import { resolveUser, resolveMember, stripObjectToScalars } from "../../../utils";
import { isBanned } from "../functions/isBanned";
import { readContactMethodsFromArgs } from "../functions/readContactMethodsFromArgs";
import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments";
import { banUserId } from "../functions/banUserId";
import { ignoreEvent } from "../functions/ignoreEvent";
import { LogType } from "../../../data/LogType";
import { CaseTypes } from "../../../data/CaseTypes";
import { LogType } from "../../../data/LogType";
import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin";
import { canActOn, hasPermission, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
import { resolveMember, resolveUser, stripObjectToScalars } from "../../../utils";
import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments";
import { ignoreEvent } from "../functions/ignoreEvent";
import { isBanned } from "../functions/isBanned";
import { IgnoredEventType, modActionsCmd } from "../types";
const opts = {
mod: ct.member({ option: true }),

View file

@ -1,8 +1,8 @@
import { modActionsCmd } from "../types";
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";
const opts = {
mod: ct.member({ option: true }),

View file

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

View file

@ -1,6 +1,6 @@
import { modActionsCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
import { modActionsCmd } from "../types";
export const HideCaseCmd = modActionsCmd({
trigger: ["hide", "hidecase", "hide_case"],

View file

@ -1,11 +1,6 @@
import { modActionsCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { canActOn, sendErrorMessage } from "../../../pluginUtils";
import { resolveUser, resolveMember } from "../../../utils";
import { MutesPlugin } from "../../../plugins/Mutes/MutesPlugin";
import { actualUnmuteCmd } from "../functions/actualUnmuteUserCmd";
import { isBanned } from "../functions/isBanned";
import { actualKickMemberCmd } from "../functions/actualKickMemberCmd";
import { modActionsCmd } from "../types";
const opts = {
mod: ct.member({ option: true }),

View file

@ -1,21 +1,17 @@
import { modActionsCmd, IgnoredEventType } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { canActOn, sendErrorMessage, hasPermission, sendSuccessMessage } from "../../../pluginUtils";
import { resolveUser, resolveMember, stripObjectToScalars, noop, MINUTES } from "../../../utils";
import { isBanned } from "../functions/isBanned";
import { readContactMethodsFromArgs } from "../functions/readContactMethodsFromArgs";
import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments";
import { banUserId } from "../functions/banUserId";
import { CaseTypes } from "../../../data/CaseTypes";
import { waitForReply } from "knub/dist/helpers";
import { ignoreEvent } from "../functions/ignoreEvent";
import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin";
import { LogType } from "../../../data/LogType";
import { performance } from "perf_hooks";
import { humanizeDurationShort } from "../../../humanizeDurationShort";
import { load } from "js-yaml";
import { TextChannel } from "discord.js";
import { waitForReply } from "knub/dist/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 { CasesPlugin } from "../../../plugins/Cases/CasesPlugin";
import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
import { MINUTES, noop, stripObjectToScalars } from "../../../utils";
import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments";
import { ignoreEvent } from "../functions/ignoreEvent";
import { IgnoredEventType, modActionsCmd } from "../types";
export const MassbanCmd = modActionsCmd({
trigger: "massban",

View file

@ -1,16 +1,16 @@
import { modActionsCmd, IgnoredEventType } from "../types";
import { TextChannel } from "discord.js";
import { waitForReply } from "knub/dist/helpers";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { CaseTypes } from "../../../data/CaseTypes";
import { LogType } from "../../../data/LogType";
import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
import { stripObjectToScalars } from "../../../utils";
import { isBanned } from "../functions/isBanned";
import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments";
import { CaseTypes } from "../../../data/CaseTypes";
import { waitForReply } from "knub/dist/helpers";
import { ignoreEvent } from "../functions/ignoreEvent";
import { CasesPlugin } from "../../Cases/CasesPlugin";
import { LogType } from "../../../data/LogType";
import { TextChannel } from "discord.js";
import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments";
import { ignoreEvent } from "../functions/ignoreEvent";
import { isBanned } from "../functions/isBanned";
import { IgnoredEventType, modActionsCmd } from "../types";
export const MassunbanCmd = modActionsCmd({
trigger: "massunban",

View file

@ -1,14 +1,14 @@
import { modActionsCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
import { stripObjectToScalars } from "../../../utils";
import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments";
import { TextChannel } from "discord.js";
import { waitForReply } from "knub/dist/helpers";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { LogType } from "../../../data/LogType";
import { logger } from "../../../logger";
import { MutesPlugin } from "../../../plugins/Mutes/MutesPlugin";
import { TextChannel } from "discord.js";
import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
import { stripObjectToScalars } from "../../../utils";
import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments";
import { modActionsCmd } from "../types";
export const MassmuteCmd = modActionsCmd({
trigger: "massmute",

View file

@ -1,11 +1,11 @@
import { modActionsCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { canActOn, sendErrorMessage } from "../../../pluginUtils";
import { noop, resolveMember, resolveUser } from "../../../utils";
import { isBanned } from "../functions/isBanned";
import { actualMuteUserCmd } from "../functions/actualMuteUserCmd";
import { resolveMember, resolveUser } from "../../../utils";
import { waitForButtonConfirm } from "../../../utils/waitForInteraction";
import { actualMuteUserCmd } from "../functions/actualMuteUserCmd";
import { isBanned } from "../functions/isBanned";
import { modActionsCmd } from "../types";
const opts = {
mod: ct.member({ option: true }),

View file

@ -1,12 +1,11 @@
import { modActionsCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { Case } from "../../../data/entities/Case";
import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments";
import { CasesPlugin } from "../../Cases/CasesPlugin";
import { LogType } from "../../../data/LogType";
import { CaseTypes } from "../../../data/CaseTypes";
import { LogType } from "../../../data/LogType";
import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
import { resolveUser, stripObjectToScalars } from "../../../utils";
import { CasesPlugin } from "../../Cases/CasesPlugin";
import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments";
import { modActionsCmd } from "../types";
export const NoteCmd = modActionsCmd({
trigger: "note",

View file

@ -1,7 +1,7 @@
import { modActionsCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { trimPluginDescription } from "../../../utils";
import { actualKickMemberCmd } from "../functions/actualKickMemberCmd";
import { modActionsCmd } from "../types";
const opts = {
mod: ct.member({ option: true }),

View file

@ -1,12 +1,12 @@
import { modActionsCmd, IgnoredEventType } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { sendErrorMessage, hasPermission, sendSuccessMessage } from "../../../pluginUtils";
import { CaseTypes } from "../../../data/CaseTypes";
import { LogType } from "../../../data/LogType";
import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin";
import { hasPermission, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
import { resolveUser, stripObjectToScalars } from "../../../utils";
import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments";
import { LogType } from "../../../data/LogType";
import { ignoreEvent } from "../functions/ignoreEvent";
import { CaseTypes } from "../../../data/CaseTypes";
import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin";
import { IgnoredEventType, modActionsCmd } from "../types";
const opts = {
mod: ct.member({ option: true }),

View file

@ -1,6 +1,6 @@
import { modActionsCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
import { modActionsCmd } from "../types";
export const UnhideCaseCmd = modActionsCmd({
trigger: ["unhide", "unhidecase", "unhide_case"],

View file

@ -1,11 +1,11 @@
import { modActionsCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { canActOn, sendErrorMessage } from "../../../pluginUtils";
import { resolveUser, resolveMember, noop } from "../../../utils";
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 { waitForButtonConfirm } from "../../../utils/waitForInteraction";
import { modActionsCmd } from "../types";
const opts = {
mod: ct.member({ option: true }),

View file

@ -1,6 +1,6 @@
import { modActionsCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { updateCase } from "../functions/updateCase";
import { modActionsCmd } from "../types";
export const UpdateCmd = modActionsCmd({
trigger: ["update", "reason"],

View file

@ -1,17 +1,15 @@
import { modActionsCmd } from "../types";
import { TextChannel } from "discord.js";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { Case } from "../../../data/entities/Case";
import { canActOn, hasPermission, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
import { formatReasonWithAttachments } from "../functions/formatReasonWithAttachments";
import { CasesPlugin } from "../../Cases/CasesPlugin";
import { LogType } from "../../../data/LogType";
import { CaseTypes } from "../../../data/CaseTypes";
import { canActOn, hasPermission, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
import { errorMessage, 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 { TextChannel } from "discord.js";
import { waitForButtonConfirm } from "../../../utils/waitForInteraction";
import { modActionsCmd } from "../types";
export const WarnCmd = modActionsCmd({
trigger: "warn",

View file

@ -1,14 +1,14 @@
import { IgnoredEventType, modActionsEvt } from "../types";
import { isEventIgnored } from "../functions/isEventIgnored";
import { clearIgnoredEvents } from "../functions/clearIgnoredEvents";
import { CasesPlugin } from "../../Cases/CasesPlugin";
import { CaseTypes } from "../../../data/CaseTypes";
import { safeFindRelevantAuditLogEntry } from "../../../utils/safeFindRelevantAuditLogEntry";
import { LogType } from "../../../data/LogType";
import { stripObjectToScalars, resolveUser, UnknownUser } from "../../../utils";
import { Case } from "../../../data/entities/Case";
import { GuildAuditLogs, User } from "discord.js";
import { CaseTypes } from "../../../data/CaseTypes";
import { Case } from "../../../data/entities/Case";
import { LogType } from "../../../data/LogType";
import { resolveUser, stripObjectToScalars, UnknownUser } from "../../../utils";
import { safeFindRelevantAuditLogEntry } from "../../../utils/safeFindRelevantAuditLogEntry";
import { CasesPlugin } from "../../Cases/CasesPlugin";
import { clearIgnoredEvents } from "../functions/clearIgnoredEvents";
import { isEventIgnored } from "../functions/isEventIgnored";
import { IgnoredEventType, modActionsEvt } from "../types";
/**
* Create a BAN case automatically when a user is banned manually.

View file

@ -1,15 +1,15 @@
import { IgnoredEventType, modActionsEvt } from "../types";
import { isEventIgnored } from "../functions/isEventIgnored";
import { clearIgnoredEvents } from "../functions/clearIgnoredEvents";
import { CasesPlugin } from "../../Cases/CasesPlugin";
import { GuildAuditLogs, User } from "discord.js";
import { CaseTypes } from "../../../data/CaseTypes";
import { logger } from "../../../logger";
import { Case } from "../../../data/entities/Case";
import { LogType } from "../../../data/LogType";
import { logger } from "../../../logger";
import { resolveUser, stripObjectToScalars, UnknownUser } from "../../../utils";
import { safeFindRelevantAuditLogEntry } from "../../../utils/safeFindRelevantAuditLogEntry";
import { Case } from "../../../data/entities/Case";
import { GuildAuditLogs, User } from "discord.js";
import { CasesPlugin } from "../../Cases/CasesPlugin";
import { clearIgnoredEvents } from "../functions/clearIgnoredEvents";
import { isEventIgnored } from "../functions/isEventIgnored";
import { IgnoredEventType, modActionsEvt } from "../types";
/**
* Create a KICK case automatically when a user is kicked manually.

View file

@ -1,14 +1,14 @@
import { IgnoredEventType, modActionsEvt } from "../types";
import { isEventIgnored } from "../functions/isEventIgnored";
import { clearIgnoredEvents } from "../functions/clearIgnoredEvents";
import { CasesPlugin } from "../../Cases/CasesPlugin";
import { CaseTypes } from "../../../data/CaseTypes";
import { safeFindRelevantAuditLogEntry } from "../../../utils/safeFindRelevantAuditLogEntry";
import { stripObjectToScalars, resolveUser, UnknownUser } from "../../../utils";
import { LogType } from "../../../data/LogType";
import { Case } from "../../../data/entities/Case";
import { GuildAuditLogs, User } from "discord.js";
import { CaseTypes } from "../../../data/CaseTypes";
import { Case } from "../../../data/entities/Case";
import { LogType } from "../../../data/LogType";
import { resolveUser, stripObjectToScalars, UnknownUser } from "../../../utils";
import { safeFindRelevantAuditLogEntry } from "../../../utils/safeFindRelevantAuditLogEntry";
import { CasesPlugin } from "../../Cases/CasesPlugin";
import { clearIgnoredEvents } from "../functions/clearIgnoredEvents";
import { isEventIgnored } from "../functions/isEventIgnored";
import { IgnoredEventType, modActionsEvt } from "../types";
/**
* Create an UNBAN case automatically when a user is unbanned manually.

View file

@ -1,10 +1,10 @@
import { modActionsEvt } from "../types";
import { LogsPlugin } from "../../Logs/LogsPlugin";
import { Permissions, TextChannel } from "discord.js";
import { LogType } from "../../../data/LogType";
import { resolveMember } from "../../../utils";
import { hasDiscordPermissions } from "../../../utils/hasDiscordPermissions";
import { TextChannel, Constants, Permissions } from "discord.js";
import { LogsPlugin } from "../../Logs/LogsPlugin";
import { modActionsEvt } from "../types";
/**
* Show an alert if a member with prior notes joins the server

View file

@ -1,15 +1,15 @@
import { LogType } from "../../../data/LogType";
import { IgnoredEventType, ModActionsPluginType } from "../types";
import { errorMessage, resolveUser, resolveMember } from "../../../utils";
import { GuildMember, TextChannel } from "discord.js";
import { GuildPluginData } from "knub";
import { sendErrorMessage, canActOn, sendSuccessMessage } from "../../../pluginUtils";
import { hasPermission } from "knub/dist/helpers";
import { readContactMethodsFromArgs } from "./readContactMethodsFromArgs";
import { LogType } from "../../../data/LogType";
import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
import { errorMessage, resolveMember, resolveUser } from "../../../utils";
import { IgnoredEventType, ModActionsPluginType } from "../types";
import { formatReasonWithAttachments } from "./formatReasonWithAttachments";
import { kickMember } from "./kickMember";
import { ignoreEvent } from "./ignoreEvent";
import { isBanned } from "./isBanned";
import { GuildMember, TextChannel } from "discord.js";
import { kickMember } from "./kickMember";
import { readContactMethodsFromArgs } from "./readContactMethodsFromArgs";
export async function actualKickMemberCmd(
pluginData: GuildPluginData<ModActionsPluginType>,

View file

@ -1,15 +1,15 @@
import { asSingleLine, isDiscordRESTError, UnknownUser } from "../../../utils";
import { hasPermission, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
import { GuildPluginData } from "knub";
import { ModActionsPluginType } from "../types";
import { GuildMember, Message, TextChannel, User } from "discord.js";
import humanizeDuration from "humanize-duration";
import { formatReasonWithAttachments } from "./formatReasonWithAttachments";
import { MuteResult } from "../../Mutes/types";
import { MutesPlugin } from "../../Mutes/MutesPlugin";
import { readContactMethodsFromArgs } from "./readContactMethodsFromArgs";
import { ERRORS, RecoverablePluginError } from "../../../RecoverablePluginError";
import { GuildPluginData } from "knub";
import { logger } from "../../../logger";
import { User, Message, TextChannel, GuildMember } from "discord.js";
import { hasPermission, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
import { ERRORS, RecoverablePluginError } from "../../../RecoverablePluginError";
import { asSingleLine, isDiscordRESTError, UnknownUser } from "../../../utils";
import { MutesPlugin } from "../../Mutes/MutesPlugin";
import { MuteResult } from "../../Mutes/types";
import { ModActionsPluginType } from "../types";
import { formatReasonWithAttachments } from "./formatReasonWithAttachments";
import { readContactMethodsFromArgs } from "./readContactMethodsFromArgs";
/**
* The actual function run by both !mute and !forcemute.

View file

@ -1,12 +1,12 @@
import { GuildPluginData } from "knub";
import { ModActionsPluginType } from "../types";
import { UnknownUser, asSingleLine } from "../../../utils";
import { sendErrorMessage, sendSuccessMessage, hasPermission } from "../../../pluginUtils";
import { formatReasonWithAttachments } from "./formatReasonWithAttachments";
import { MutesPlugin } from "../../../plugins/Mutes/MutesPlugin";
import { GuildMember, Message, TextChannel, User } from "discord.js";
import humanizeDuration from "humanize-duration";
import { User, Message, GuildMember, TextChannel } from "discord.js";
import { GuildPluginData } from "knub";
import { MutesPlugin } from "../../../plugins/Mutes/MutesPlugin";
import { hasPermission, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
import { asSingleLine, UnknownUser } from "../../../utils";
import { ModActionsPluginType } from "../types";
import { formatReasonWithAttachments } from "./formatReasonWithAttachments";
export async function actualUnmuteCmd(
pluginData: GuildPluginData<ModActionsPluginType>,

View file

@ -1,23 +1,23 @@
import { GuildPluginData } from "knub";
import { BanOptions, BanResult, IgnoredEventType, ModActionsPluginType } from "../types";
import {
createUserNotificationError,
notifyUser,
resolveUser,
stripObjectToScalars,
ucfirst,
UserNotificationResult,
} from "../../../utils";
import { renderTemplate } from "../../../templateFormatter";
import { getDefaultContactMethods } from "./getDefaultContactMethods";
import { LogType } from "../../../data/LogType";
import { ignoreEvent } from "./ignoreEvent";
import { CasesPlugin } from "../../Cases/CasesPlugin";
import { CaseTypes } from "../../../data/CaseTypes";
import { logger } from "../../../logger";
import humanizeDuration from "humanize-duration";
import { DiscordAPIError, User } from "discord.js";
import humanizeDuration from "humanize-duration";
import { GuildPluginData } from "knub";
import { CaseTypes } from "../../../data/CaseTypes";
import { LogType } from "../../../data/LogType";
import { logger } from "../../../logger";
import { renderTemplate } from "../../../templateFormatter";
import {
createUserNotificationError,
notifyUser,
resolveUser,
stripObjectToScalars,
ucfirst,
UserNotificationResult
} from "../../../utils";
import { CasesPlugin } from "../../Cases/CasesPlugin";
import { BanOptions, BanResult, IgnoredEventType, ModActionsPluginType } from "../types";
import { getDefaultContactMethods } from "./getDefaultContactMethods";
import { ignoreEvent } from "./ignoreEvent";
/**
* Ban the specified user id, whether or not they're actually on the server at the time. Generates a case.

View file

@ -1,7 +1,7 @@
import { GuildPluginData } from "knub";
import { ModActionsPluginType } from "../types";
import { UserNotificationMethod } from "../../../utils";
import { TextChannel } from "discord.js";
import { GuildPluginData } from "knub";
import { UserNotificationMethod } from "../../../utils";
import { ModActionsPluginType } from "../types";
export function getDefaultContactMethods(
pluginData: GuildPluginData<ModActionsPluginType>,

View file

@ -1,6 +1,6 @@
import { GuildPluginData } from "knub";
import { IgnoredEventType, ModActionsPluginType } from "../types";
import { SECONDS } from "../../../utils";
import { IgnoredEventType, ModActionsPluginType } from "../types";
import { clearIgnoredEvents } from "./clearIgnoredEvents";
const DEFAULT_TIMEOUT = 15 * SECONDS;

View file

@ -1,10 +1,10 @@
import { GuildPluginData } from "knub";
import { ModActionsPluginType } from "../types";
import { isDiscordHTTPError, isDiscordRESTError, SECONDS, sleep } from "../../../utils";
import { LogsPlugin } from "../../Logs/LogsPlugin";
import { LogType } from "../../../data/LogType";
import { hasDiscordPermissions } from "../../../utils/hasDiscordPermissions";
import { Permissions } from "discord.js";
import { GuildPluginData } from "knub";
import { LogType } from "../../../data/LogType";
import { isDiscordHTTPError, isDiscordRESTError, SECONDS, sleep } from "../../../utils";
import { hasDiscordPermissions } from "../../../utils/hasDiscordPermissions";
import { LogsPlugin } from "../../Logs/LogsPlugin";
import { ModActionsPluginType } from "../types";
export async function isBanned(
pluginData: GuildPluginData<ModActionsPluginType>,

View file

@ -1,21 +1,21 @@
import { GuildPluginData } from "knub";
import { IgnoredEventType, KickOptions, KickResult, ModActionsPluginType } from "../types";
import {
createUserNotificationError,
notifyUser,
resolveUser,
stripObjectToScalars,
ucfirst,
UserNotificationResult,
} from "../../../utils";
import { renderTemplate } from "../../../templateFormatter";
import { getDefaultContactMethods } from "./getDefaultContactMethods";
import { LogType } from "../../../data/LogType";
import { ignoreEvent } from "./ignoreEvent";
import { CaseTypes } from "../../../data/CaseTypes";
import { CasesPlugin } from "../../Cases/CasesPlugin";
import { GuildMember } from "discord.js";
import { GuildPluginData } from "knub";
import { CaseTypes } from "../../../data/CaseTypes";
import { LogType } from "../../../data/LogType";
import { renderTemplate } from "../../../templateFormatter";
import {
createUserNotificationError,
notifyUser,
resolveUser,
stripObjectToScalars,
ucfirst,
UserNotificationResult
} from "../../../utils";
import { CasesPlugin } from "../../Cases/CasesPlugin";
import { IgnoredEventType, KickOptions, KickResult, ModActionsPluginType } from "../types";
import { getDefaultContactMethods } from "./getDefaultContactMethods";
import { ignoreEvent } from "./ignoreEvent";
/**
* Kick the specified server member. Generates a case.

View file

@ -1,15 +1,15 @@
import { resolveUser, SECONDS, stripObjectToScalars } from "../../../utils";
import humanizeDuration from "humanize-duration";
import { GuildPluginData } from "knub";
import { IgnoredEventType, ModActionsPluginType } from "../types";
import moment from "moment-timezone";
import { LogType } from "src/data/LogType";
import { logger } from "src/logger";
import { CaseTypes } from "../../../data/CaseTypes";
import { resolveUser, SECONDS, stripObjectToScalars } from "../../../utils";
import { CasesPlugin } from "../../Cases/CasesPlugin";
import { IgnoredEventType, ModActionsPluginType } from "../types";
import { formatReasonWithAttachments } from "./formatReasonWithAttachments";
import { ignoreEvent } from "./ignoreEvent";
import { isBanned } from "./isBanned";
import { logger } from "src/logger";
import { CasesPlugin } from "../../Cases/CasesPlugin";
import { CaseTypes } from "../../../data/CaseTypes";
import moment from "moment-timezone";
import humanizeDuration from "humanize-duration";
const TEMPBAN_LOOP_TIME = 60 * SECONDS;

View file

@ -1,21 +1,21 @@
import { GuildMember } from "discord.js";
import { GuildPluginData } from "knub";
import { ModActionsPluginType, WarnOptions, WarnResult } from "../types";
import { getDefaultContactMethods } from "./getDefaultContactMethods";
import {
createUserNotificationError,
notifyUser,
resolveUser,
stripObjectToScalars,
ucfirst,
UserNotificationResult,
} from "../../../utils";
import { CasesPlugin } from "../../Cases/CasesPlugin";
import { CaseTypes } from "../../../data/CaseTypes";
import { LogType } from "../../../data/LogType";
import { renderTemplate } from "../../../templateFormatter";
import { GuildMember, MessageOptions } from "discord.js";
import {
createUserNotificationError,
notifyUser,
resolveUser,
stripObjectToScalars,
ucfirst,
UserNotificationResult
} from "../../../utils";
import { waitForButtonConfirm } from "../../../utils/waitForInteraction";
import { CasesPlugin } from "../../Cases/CasesPlugin";
import { ModActionsPluginType, WarnOptions, WarnResult } from "../types";
import { getDefaultContactMethods } from "./getDefaultContactMethods";
export async function warnMember(
pluginData: GuildPluginData<ModActionsPluginType>,

View file

@ -1,17 +1,17 @@
import { TextChannel } from "discord.js";
import { EventEmitter } from "events";
import * as t from "io-ts";
import { tNullable, UserNotificationMethod, UserNotificationResult } from "../../utils";
import { BasePluginType, typedGuildCommand, typedGuildEventListener } from "knub";
import { GuildMutes } from "../../data/GuildMutes";
import { Case } from "../../data/entities/Case";
import { GuildCases } from "../../data/GuildCases";
import { GuildLogs } from "../../data/GuildLogs";
import { Case } from "../../data/entities/Case";
import { GuildMutes } from "../../data/GuildMutes";
import { GuildTempbans } from "../../data/GuildTempbans";
import { Queue } from "../../Queue";
import { tNullable, UserNotificationMethod, UserNotificationResult } from "../../utils";
import { CaseArgs } from "../Cases/types";
import { GuildTempbans } from "../../data/GuildTempbans";
import Timeout = NodeJS.Timeout;
import { EventEmitter } from "events";
import { Queue } from "../../Queue";
import { TextChannel } from "discord.js";
export const ConfigSchema = t.type({
dm_on_warn: t.boolean,