mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-17 15:15: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,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>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue