mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 20:35:02 +00:00
Organise all imports, make Mutes depend on Logs
This commit is contained in:
parent
a94e7593ec
commit
6ac9d2f2a2
437 changed files with 1912 additions and 2027 deletions
|
@ -1,26 +1,27 @@
|
|||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { ConfigSchema, MuteOptions, MutesPluginType } from "./types";
|
||||
import { CasesPlugin } from "../Cases/CasesPlugin";
|
||||
import { GuildMutes } from "../../data/GuildMutes";
|
||||
import { GuildMember } from "discord.js";
|
||||
import { EventEmitter } from "events";
|
||||
import { GuildArchives } from "../../data/GuildArchives";
|
||||
import { GuildCases } from "../../data/GuildCases";
|
||||
import { GuildLogs } from "../../data/GuildLogs";
|
||||
import { GuildArchives } from "../../data/GuildArchives";
|
||||
import { clearExpiredMutes } from "./functions/clearExpiredMutes";
|
||||
import { MutesCmd } from "./commands/MutesCmd";
|
||||
import { ClearBannedMutesCmd } from "./commands/ClearBannedMutesCmd";
|
||||
import { ClearActiveMuteOnRoleRemovalEvt } from "./events/ClearActiveMuteOnRoleRemovalEvt";
|
||||
import { ClearMutesWithoutRoleCmd } from "./commands/ClearMutesWithoutRoleCmd";
|
||||
import { ClearMutesCmd } from "./commands/ClearMutesCmd";
|
||||
import { muteUser } from "./functions/muteUser";
|
||||
import { unmuteUser } from "./functions/unmuteUser";
|
||||
|
||||
import { ClearActiveMuteOnMemberBanEvt } from "./events/ClearActiveMuteOnMemberBanEvt";
|
||||
import { ReapplyActiveMuteOnJoinEvt } from "./events/ReapplyActiveMuteOnJoinEvt";
|
||||
import { GuildMutes } from "../../data/GuildMutes";
|
||||
import { mapToPublicFn } from "../../pluginUtils";
|
||||
import { EventEmitter } from "events";
|
||||
import { onMutesEvent } from "./functions/onMutesEvent";
|
||||
import { CasesPlugin } from "../Cases/CasesPlugin";
|
||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { ClearBannedMutesCmd } from "./commands/ClearBannedMutesCmd";
|
||||
import { ClearMutesCmd } from "./commands/ClearMutesCmd";
|
||||
import { ClearMutesWithoutRoleCmd } from "./commands/ClearMutesWithoutRoleCmd";
|
||||
import { MutesCmd } from "./commands/MutesCmd";
|
||||
import { ClearActiveMuteOnMemberBanEvt } from "./events/ClearActiveMuteOnMemberBanEvt";
|
||||
import { ClearActiveMuteOnRoleRemovalEvt } from "./events/ClearActiveMuteOnRoleRemovalEvt";
|
||||
import { ReapplyActiveMuteOnJoinEvt } from "./events/ReapplyActiveMuteOnJoinEvt";
|
||||
import { clearExpiredMutes } from "./functions/clearExpiredMutes";
|
||||
import { muteUser } from "./functions/muteUser";
|
||||
import { offMutesEvent } from "./functions/offMutesEvent";
|
||||
import { GuildMember } from "discord.js";
|
||||
import { onMutesEvent } from "./functions/onMutesEvent";
|
||||
import { unmuteUser } from "./functions/unmuteUser";
|
||||
import { ConfigSchema, MutesPluginType } from "./types";
|
||||
|
||||
|
||||
const defaultOptions = {
|
||||
config: {
|
||||
|
@ -72,7 +73,7 @@ export const MutesPlugin = zeppelinGuildPlugin<MutesPluginType>()({
|
|||
configSchema: ConfigSchema,
|
||||
defaultOptions,
|
||||
|
||||
dependencies: [CasesPlugin],
|
||||
dependencies: [CasesPlugin, LogsPlugin],
|
||||
|
||||
// prettier-ignore
|
||||
commands: [
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { User } from "discord.js";
|
||||
import { sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { mutesCmd } from "../types";
|
||||
|
||||
import { sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { User } from "discord.js";
|
||||
|
||||
export const ClearBannedMutesCmd = mutesCmd({
|
||||
trigger: "clear_banned_mutes",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { mutesCmd } from "../types";
|
||||
import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { mutesCmd } from "../types";
|
||||
|
||||
export const ClearMutesCmd = mutesCmd({
|
||||
trigger: "clear_mutes",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { mutesCmd } from "../types";
|
||||
import { sendSuccessMessage } from "../../../pluginUtils";
|
||||
import { resolveMember } from "../../../utils";
|
||||
import { mutesCmd } from "../types";
|
||||
|
||||
export const ClearMutesWithoutRoleCmd = mutesCmd({
|
||||
trigger: "clear_mutes_without_role",
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { IMuteWithDetails, mutesCmd } from "../types";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { DBDateFormat, isFullMessage, MINUTES, noop, resolveMember } from "../../../utils";
|
||||
import { GuildMember } from "discord.js";
|
||||
import moment from "moment-timezone";
|
||||
import { commandTypeHelpers as ct } from "../../../commandTypes";
|
||||
import { humanizeDurationShort } from "../../../humanizeDurationShort";
|
||||
import { getBaseUrl } from "../../../pluginUtils";
|
||||
import { GuildMember } from "discord.js";
|
||||
import { DBDateFormat, isFullMessage, MINUTES, noop, resolveMember } from "../../../utils";
|
||||
import { IMuteWithDetails, mutesCmd } from "../types";
|
||||
|
||||
export const MutesCmd = mutesCmd({
|
||||
trigger: "mutes",
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { mutesEvt } from "../types";
|
||||
import { memberHasMutedRole } from "../functions/memberHasMutedRole";
|
||||
import { mutesEvt } from "../types";
|
||||
|
||||
/**
|
||||
* Clear active mute if the mute role is removed manually
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { mutesEvt } from "../types";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
import { stripObjectToScalars } from "../../../utils";
|
||||
import { memberRolesLock } from "../../../utils/lockNameHelpers";
|
||||
import { mutesEvt } from "../types";
|
||||
|
||||
/**
|
||||
* Reapply active mutes on join
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import { MutesPluginType } from "../types";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
import { resolveMember, stripObjectToScalars, UnknownUser } from "../../../utils";
|
||||
|
||||
import { memberRolesLock } from "../../../utils/lockNameHelpers";
|
||||
import { MutesPluginType } from "../types";
|
||||
|
||||
|
||||
export async function clearExpiredMutes(pluginData: GuildPluginData<MutesPluginType>) {
|
||||
const expiredMutes = await pluginData.state.mutes.getExpiredMutes();
|
||||
|
|
|
@ -1,25 +1,29 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import { MuteOptions, MutesPluginType } from "../types";
|
||||
import { ERRORS, RecoverablePluginError } from "../../../RecoverablePluginError";
|
||||
import humanizeDuration from "humanize-duration";
|
||||
import {
|
||||
notifyUser,
|
||||
resolveUser,
|
||||
stripObjectToScalars,
|
||||
ucfirst,
|
||||
UserNotificationResult,
|
||||
resolveMember,
|
||||
UserNotificationMethod,
|
||||
} from "../../../utils";
|
||||
import { renderTemplate } from "../../../templateFormatter";
|
||||
|
||||
import { CasesPlugin } from "../../Cases/CasesPlugin";
|
||||
import { CaseTypes } from "../../../data/CaseTypes";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
import { Case } from "../../../data/entities/Case";
|
||||
import { LogsPlugin } from "../../../plugins/Logs/LogsPlugin";
|
||||
import { muteLock } from "../../../utils/lockNameHelpers";
|
||||
import { TextChannel, User } from "discord.js";
|
||||
import humanizeDuration from "humanize-duration";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { CaseTypes } from "../../../data/CaseTypes";
|
||||
import { Case } from "../../../data/entities/Case";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
import { LogsPlugin } from "../../../plugins/Logs/LogsPlugin";
|
||||
import { ERRORS, RecoverablePluginError } from "../../../RecoverablePluginError";
|
||||
import { renderTemplate } from "../../../templateFormatter";
|
||||
import {
|
||||
notifyUser,
|
||||
|
||||
|
||||
|
||||
|
||||
resolveMember, resolveUser,
|
||||
stripObjectToScalars,
|
||||
ucfirst,
|
||||
|
||||
|
||||
UserNotificationMethod, UserNotificationResult
|
||||
} from "../../../utils";
|
||||
import { muteLock } from "../../../utils/lockNameHelpers";
|
||||
import { CasesPlugin } from "../../Cases/CasesPlugin";
|
||||
import { MuteOptions, MutesPluginType } from "../types";
|
||||
|
||||
|
||||
export async function muteUser(
|
||||
pluginData: GuildPluginData<MutesPluginType>,
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import { MutesPluginType, UnmuteResult } from "../types";
|
||||
import { CaseArgs } from "../../Cases/types";
|
||||
import { resolveUser, stripObjectToScalars, resolveMember } from "../../../utils";
|
||||
import { memberHasMutedRole } from "./memberHasMutedRole";
|
||||
import humanizeDuration from "humanize-duration";
|
||||
import { CasesPlugin } from "../../Cases/CasesPlugin";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { CaseTypes } from "../../../data/CaseTypes";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
|
||||
import { resolveMember, resolveUser, stripObjectToScalars } from "../../../utils";
|
||||
import { memberRolesLock } from "../../../utils/lockNameHelpers";
|
||||
import { CasesPlugin } from "../../Cases/CasesPlugin";
|
||||
import { CaseArgs } from "../../Cases/types";
|
||||
import { MutesPluginType, UnmuteResult } from "../types";
|
||||
import { memberHasMutedRole } from "./memberHasMutedRole";
|
||||
|
||||
|
||||
export async function unmuteUser(
|
||||
pluginData: GuildPluginData<MutesPluginType>,
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
import * as t from "io-ts";
|
||||
import { tNullable, UserNotificationMethod, UserNotificationResult } from "../../utils";
|
||||
import { Mute } from "../../data/entities/Mute";
|
||||
|
||||
import { Case } from "../../data/entities/Case";
|
||||
import { BasePluginType, typedGuildCommand, typedGuildEventListener } from "knub";
|
||||
import { GuildLogs } from "../../data/GuildLogs";
|
||||
import { GuildCases } from "../../data/GuildCases";
|
||||
import { GuildArchives } from "../../data/GuildArchives";
|
||||
import { GuildMutes } from "../../data/GuildMutes";
|
||||
import { CaseArgs } from "../Cases/types";
|
||||
import Timeout = NodeJS.Timeout;
|
||||
import { EventEmitter } from "events";
|
||||
import { GuildMember } from "discord.js";
|
||||
import { EventEmitter } from "events";
|
||||
import * as t from "io-ts";
|
||||
import { BasePluginType, typedGuildCommand, typedGuildEventListener } from "knub";
|
||||
import { Case } from "../../data/entities/Case";
|
||||
import { Mute } from "../../data/entities/Mute";
|
||||
import { GuildArchives } from "../../data/GuildArchives";
|
||||
import { GuildCases } from "../../data/GuildCases";
|
||||
import { GuildLogs } from "../../data/GuildLogs";
|
||||
import { GuildMutes } from "../../data/GuildMutes";
|
||||
import { tNullable, UserNotificationMethod, UserNotificationResult } from "../../utils";
|
||||
import { CaseArgs } from "../Cases/types";
|
||||
|
||||
import Timeout = NodeJS.Timeout;
|
||||
|
||||
export const ConfigSchema = t.type({
|
||||
mute_role: tNullable(t.string),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue