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,21 +1,21 @@
|
|||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { CaseArgs, CaseNoteArgs, CasesPluginType, ConfigSchema } from "./types";
|
||||
import { createCase } from "./functions/createCase";
|
||||
import { GuildLogs } from "../../data/GuildLogs";
|
||||
import { CaseTypes } from "../../data/CaseTypes";
|
||||
import { Case } from "../../data/entities/Case";
|
||||
import { GuildArchives } from "../../data/GuildArchives";
|
||||
import { GuildCases } from "../../data/GuildCases";
|
||||
import { createCaseNote } from "./functions/createCaseNote";
|
||||
import { Case } from "../../data/entities/Case";
|
||||
import { postCaseToCaseLogChannel } from "./functions/postToCaseLogChannel";
|
||||
import { CaseTypes } from "../../data/CaseTypes";
|
||||
import { getCaseTypeAmountForUserId } from "./functions/getCaseTypeAmountForUserId";
|
||||
import { getCaseEmbed } from "./functions/getCaseEmbed";
|
||||
import { trimPluginDescription } from "../../utils";
|
||||
import { getCaseSummary } from "./functions/getCaseSummary";
|
||||
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
||||
import { GuildLogs } from "../../data/GuildLogs";
|
||||
import { mapToPublicFn } from "../../pluginUtils";
|
||||
import { getTotalCasesByMod } from "./functions/getTotalCasesByMod";
|
||||
import { trimPluginDescription } from "../../utils";
|
||||
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { createCase } from "./functions/createCase";
|
||||
import { createCaseNote } from "./functions/createCaseNote";
|
||||
import { getCaseEmbed } from "./functions/getCaseEmbed";
|
||||
import { getCaseSummary } from "./functions/getCaseSummary";
|
||||
import { getCaseTypeAmountForUserId } from "./functions/getCaseTypeAmountForUserId";
|
||||
import { getRecentCasesByMod } from "./functions/getRecentCasesByMod";
|
||||
import { getTotalCasesByMod } from "./functions/getTotalCasesByMod";
|
||||
import { postCaseToCaseLogChannel } from "./functions/postToCaseLogChannel";
|
||||
import { CaseArgs, CaseNoteArgs, CasesPluginType, ConfigSchema } from "./types";
|
||||
|
||||
const defaultOptions = {
|
||||
config: {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { CaseArgs, CasesPluginType } from "../types";
|
||||
import { resolveUser } from "../../../utils";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { logger } from "../../../logger";
|
||||
import { resolveUser } from "../../../utils";
|
||||
import { CaseArgs, CasesPluginType } from "../types";
|
||||
import { createCaseNote } from "./createCaseNote";
|
||||
import { postCaseToCaseLogChannel } from "./postToCaseLogChannel";
|
||||
import { logger } from "../../../logger";
|
||||
|
||||
export async function createCase(pluginData: GuildPluginData<CasesPluginType>, args: CaseArgs) {
|
||||
const user = await resolveUser(pluginData.client, args.userId);
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { CaseNoteArgs, CasesPluginType } from "../types";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { ERRORS, RecoverablePluginError } from "../../../RecoverablePluginError";
|
||||
import { resolveCaseId } from "./resolveCaseId";
|
||||
import { postCaseToCaseLogChannel } from "./postToCaseLogChannel";
|
||||
import { resolveUser, UnknownUser } from "../../../utils";
|
||||
import { CaseNoteArgs, CasesPluginType } from "../types";
|
||||
import { postCaseToCaseLogChannel } from "./postToCaseLogChannel";
|
||||
import { resolveCaseId } from "./resolveCaseId";
|
||||
|
||||
export async function createCaseNote(pluginData: GuildPluginData<CasesPluginType>, args: CaseNoteArgs): Promise<void> {
|
||||
const theCase = await pluginData.state.cases.find(resolveCaseId(args.caseId));
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import { CasesPluginType } from "../types";
|
||||
import { CaseTypes, CaseTypeToName } from "../../../data/CaseTypes";
|
||||
import { caseColors } from "../caseColors";
|
||||
import { CasesPluginType } from "../types";
|
||||
|
||||
export function getCaseColor(pluginData: GuildPluginData<CasesPluginType>, caseType: CaseTypes) {
|
||||
return pluginData.config.get().case_colors?.[CaseTypeToName[caseType]] ?? caseColors[caseType];
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
import { Case } from "../../../data/entities/Case";
|
||||
|
||||
import { MessageOptions } from "discord.js";
|
||||
import { GuildPluginData } from "knub";
|
||||
import moment from "moment-timezone";
|
||||
import { CaseTypes } from "../../../data/CaseTypes";
|
||||
import { GuildPluginData, helpers } from "knub";
|
||||
import { CasesPluginType } from "../types";
|
||||
import { resolveCaseId } from "./resolveCaseId";
|
||||
import { chunkLines, chunkMessageLines, emptyEmbedValue, messageLink } from "../../../utils";
|
||||
import { getCaseColor } from "./getCaseColor";
|
||||
import { Case } from "../../../data/entities/Case";
|
||||
import { chunkMessageLines, emptyEmbedValue, messageLink } from "../../../utils";
|
||||
import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin";
|
||||
import { MessageOptions } from "discord.js";
|
||||
import { CasesPluginType } from "../types";
|
||||
import { getCaseColor } from "./getCaseColor";
|
||||
import { resolveCaseId } from "./resolveCaseId";
|
||||
|
||||
|
||||
export async function getCaseEmbed(
|
||||
pluginData: GuildPluginData<CasesPluginType>,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import { CasesPluginType } from "../types";
|
||||
import { CaseTypes, CaseTypeToName } from "../../../data/CaseTypes";
|
||||
import { caseIcons } from "../caseIcons";
|
||||
import { CasesPluginType } from "../types";
|
||||
|
||||
export function getCaseIcon(pluginData: GuildPluginData<CasesPluginType>, caseType: CaseTypes) {
|
||||
return pluginData.config.get().case_icons?.[CaseTypeToName[caseType]] ?? caseIcons[caseType];
|
||||
|
|
|
@ -1,22 +1,19 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import { CasesPluginType } from "../types";
|
||||
import {
|
||||
convertDelayStringToMS,
|
||||
DAYS,
|
||||
DBDateFormat,
|
||||
disableLinkPreviews,
|
||||
emptyEmbedValue,
|
||||
messageLink,
|
||||
} from "../../../utils";
|
||||
import { CaseTypes, CaseTypeToName } from "../../../data/CaseTypes";
|
||||
import { splitMessageIntoChunks } from "knub/dist/helpers";
|
||||
import moment from "moment-timezone";
|
||||
import { Case } from "../../../data/entities/Case";
|
||||
import humanizeDuration from "humanize-duration";
|
||||
import { humanizeDurationShort } from "../../../humanizeDurationShort";
|
||||
import { caseAbbreviations } from "../caseAbbreviations";
|
||||
import { getCaseIcon } from "./getCaseIcon";
|
||||
import {
|
||||
convertDelayStringToMS,
|
||||
DAYS,
|
||||
DBDateFormat,
|
||||
disableLinkPreviews,
|
||||
|
||||
messageLink
|
||||
} from "../../../utils";
|
||||
import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin";
|
||||
import { splitIntoCleanChunks, splitMessageIntoChunks } from "knub/dist/helpers";
|
||||
import { caseAbbreviations } from "../caseAbbreviations";
|
||||
import { CasesPluginType } from "../types";
|
||||
import { getCaseIcon } from "./getCaseIcon";
|
||||
|
||||
const CASE_SUMMARY_REASON_MAX_LENGTH = 300;
|
||||
const INCLUDE_MORE_NOTES_THRESHOLD = 20;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import { CasesPluginType } from "../types";
|
||||
import { CaseTypes } from "../../../data/CaseTypes";
|
||||
import { CasesPluginType } from "../types";
|
||||
|
||||
export async function getCaseTypeAmountForUserId(
|
||||
pluginData: GuildPluginData<CasesPluginType>,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import { CasesPluginType } from "../types";
|
||||
import { Case } from "../../../data/entities/Case";
|
||||
import { CasesPluginType } from "../types";
|
||||
|
||||
export function getRecentCasesByMod(
|
||||
pluginData: GuildPluginData<CasesPluginType>,
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import { FileOptions, Message, MessageOptions, TextChannel } from "discord.js";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { CasesPluginType } from "../types";
|
||||
|
||||
import { isDiscordRESTError } from "../../../utils";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
import { Case } from "../../../data/entities/Case";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
import { isDiscordRESTError } from "../../../utils";
|
||||
import { CasesPluginType } from "../types";
|
||||
import { getCaseEmbed } from "./getCaseEmbed";
|
||||
import { resolveCaseId } from "./resolveCaseId";
|
||||
import { FileOptions, Message, MessageOptions, TextChannel } from "discord.js";
|
||||
|
||||
|
||||
export async function postToCaseLogChannel(
|
||||
pluginData: GuildPluginData<CasesPluginType>,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import * as t from "io-ts";
|
||||
import { tDelayString, tPartialDictionary, tNullable } from "../../utils";
|
||||
import { BasePluginType } from "knub";
|
||||
import { CaseNameToType, CaseTypes } from "../../data/CaseTypes";
|
||||
import { BasePluginType, typedGuildCommand, typedGuildEventListener } from "knub";
|
||||
import { GuildLogs } from "../../data/GuildLogs";
|
||||
import { GuildCases } from "../../data/GuildCases";
|
||||
import { GuildArchives } from "../../data/GuildArchives";
|
||||
import { GuildCases } from "../../data/GuildCases";
|
||||
import { GuildLogs } from "../../data/GuildLogs";
|
||||
import { tDelayString, tNullable, tPartialDictionary } from "../../utils";
|
||||
import { tColor } from "../../utils/tColor";
|
||||
|
||||
export const ConfigSchema = t.type({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue