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,15 +1,15 @@
|
|||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { PluginOptions } from "knub";
|
||||
import { ConfigSchema, SpamPluginType } from "./types";
|
||||
import { GuildLogs } from "../../data/GuildLogs";
|
||||
import { GuildArchives } from "../../data/GuildArchives";
|
||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||
import { GuildLogs } from "../../data/GuildLogs";
|
||||
import { GuildMutes } from "../../data/GuildMutes";
|
||||
import { onMessageCreate } from "./util/onMessageCreate";
|
||||
import { clearOldRecentActions } from "./util/clearOldRecentActions";
|
||||
import { SpamVoiceStateUpdateEvt } from "./events/SpamVoiceEvt";
|
||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||
import { trimPluginDescription } from "../../utils";
|
||||
import { LogsPlugin } from "../Logs/LogsPlugin";
|
||||
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
|
||||
import { SpamVoiceStateUpdateEvt } from "./events/SpamVoiceEvt";
|
||||
import { ConfigSchema, SpamPluginType } from "./types";
|
||||
import { clearOldRecentActions } from "./util/clearOldRecentActions";
|
||||
import { onMessageCreate } from "./util/onMessageCreate";
|
||||
|
||||
const defaultOptions: PluginOptions<SpamPluginType> = {
|
||||
config: {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { spamEvt, RecentActionType } from "../types";
|
||||
import { RecentActionType, spamEvt } from "../types";
|
||||
import { logAndDetectOtherSpam } from "../util/logAndDetectOtherSpam";
|
||||
|
||||
export const SpamVoiceStateUpdateEvt = spamEvt({
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import * as t from "io-ts";
|
||||
import { BasePluginType, typedGuildEventListener } from "knub";
|
||||
import { tNullable } from "../../utils";
|
||||
import { GuildLogs } from "../../data/GuildLogs";
|
||||
import { GuildArchives } from "../../data/GuildArchives";
|
||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||
import { GuildLogs } from "../../data/GuildLogs";
|
||||
import { GuildMutes } from "../../data/GuildMutes";
|
||||
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
|
||||
import { tNullable } from "../../utils";
|
||||
|
||||
const BaseSingleSpamConfig = t.type({
|
||||
interval: t.number,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import { SpamPluginType, RecentActionType } from "../types";
|
||||
import { RecentActionType, SpamPluginType } from "../types";
|
||||
|
||||
export function addRecentAction(
|
||||
pluginData: GuildPluginData<SpamPluginType>,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { RecentActionType, SpamPluginType } from "../types";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { RecentActionType, SpamPluginType } from "../types";
|
||||
|
||||
export function clearRecentUserActions(
|
||||
pluginData: GuildPluginData<SpamPluginType>,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { RecentActionType, SpamPluginType } from "../types";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { RecentActionType, SpamPluginType } from "../types";
|
||||
|
||||
export function getRecentActionCount(
|
||||
pluginData: GuildPluginData<SpamPluginType>,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { RecentActionType, SpamPluginType } from "../types";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { RecentActionType, SpamPluginType } from "../types";
|
||||
|
||||
export function getRecentActions(
|
||||
pluginData: GuildPluginData<SpamPluginType>,
|
||||
|
|
|
@ -1,29 +1,29 @@
|
|||
import { SavedMessage } from "../../../data/entities/SavedMessage";
|
||||
import { RecentActionType, SpamPluginType, TBaseSingleSpamConfig } from "../types";
|
||||
import moment from "moment-timezone";
|
||||
import { MuteResult } from "../../../plugins/Mutes/types";
|
||||
import {
|
||||
convertDelayStringToMS,
|
||||
DBDateFormat,
|
||||
noop,
|
||||
resolveMember,
|
||||
stripObjectToScalars,
|
||||
trimLines,
|
||||
} from "../../../utils";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
import { CaseTypes } from "../../../data/CaseTypes";
|
||||
import { logger } from "../../../logger";
|
||||
import { TextChannel } from "discord.js";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { MutesPlugin } from "../../../plugins/Mutes/MutesPlugin";
|
||||
import moment from "moment-timezone";
|
||||
import { CaseTypes } from "../../../data/CaseTypes";
|
||||
import { SavedMessage } from "../../../data/entities/SavedMessage";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
import { logger } from "../../../logger";
|
||||
import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin";
|
||||
import { MutesPlugin } from "../../../plugins/Mutes/MutesPlugin";
|
||||
import { MuteResult } from "../../../plugins/Mutes/types";
|
||||
import { ERRORS, RecoverablePluginError } from "../../../RecoverablePluginError";
|
||||
import {
|
||||
convertDelayStringToMS,
|
||||
DBDateFormat,
|
||||
noop,
|
||||
resolveMember,
|
||||
stripObjectToScalars,
|
||||
trimLines
|
||||
} from "../../../utils";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { RecentActionType, SpamPluginType, TBaseSingleSpamConfig } from "../types";
|
||||
import { addRecentAction } from "./addRecentAction";
|
||||
import { clearRecentUserActions } from "./clearRecentUserActions";
|
||||
import { getRecentActionCount } from "./getRecentActionCount";
|
||||
import { getRecentActions } from "./getRecentActions";
|
||||
import { clearRecentUserActions } from "./clearRecentUserActions";
|
||||
import { saveSpamArchives } from "./saveSpamArchives";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { ERRORS, RecoverablePluginError } from "../../../RecoverablePluginError";
|
||||
import { TextChannel } from "discord.js";
|
||||
|
||||
export async function logAndDetectMessageSpam(
|
||||
pluginData: GuildPluginData<SpamPluginType>,
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import { SpamPluginType, RecentActionType } from "../types";
|
||||
import { addRecentAction } from "./addRecentAction";
|
||||
import { getRecentActionCount } from "./getRecentActionCount";
|
||||
import { resolveMember, convertDelayStringToMS, stripObjectToScalars } from "../../../utils";
|
||||
import { MutesPlugin } from "../../../plugins/Mutes/MutesPlugin";
|
||||
import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin";
|
||||
import { CaseTypes } from "../../../data/CaseTypes";
|
||||
import { clearRecentUserActions } from "./clearRecentUserActions";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
import { CasesPlugin } from "../../../plugins/Cases/CasesPlugin";
|
||||
import { MutesPlugin } from "../../../plugins/Mutes/MutesPlugin";
|
||||
import { ERRORS, RecoverablePluginError } from "../../../RecoverablePluginError";
|
||||
import { convertDelayStringToMS, resolveMember, stripObjectToScalars } from "../../../utils";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { RecentActionType, SpamPluginType } from "../types";
|
||||
import { addRecentAction } from "./addRecentAction";
|
||||
import { clearRecentUserActions } from "./clearRecentUserActions";
|
||||
import { getRecentActionCount } from "./getRecentActionCount";
|
||||
|
||||
export async function logAndDetectOtherSpam(
|
||||
pluginData: GuildPluginData<SpamPluginType>,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import { SpamPluginType, RecentActionType } from "../types";
|
||||
import { SavedMessage } from "../../../data/entities/SavedMessage";
|
||||
import { RecentActionType, SpamPluginType } from "../types";
|
||||
import { logAndDetectMessageSpam } from "./logAndDetectMessageSpam";
|
||||
|
||||
export async function logCensor(pluginData: GuildPluginData<SpamPluginType>, savedMessage: SavedMessage) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import { SpamPluginType, RecentActionType } from "../types";
|
||||
import { SavedMessage } from "../../../data/entities/SavedMessage";
|
||||
import { getUserMentions, getRoleMentions, getUrlsInString, getEmojiInString } from "../../../utils";
|
||||
import { getEmojiInString, getRoleMentions, getUrlsInString, getUserMentions } from "../../../utils";
|
||||
import { RecentActionType, SpamPluginType } from "../types";
|
||||
import { logAndDetectMessageSpam } from "./logAndDetectMessageSpam";
|
||||
|
||||
export async function onMessageCreate(pluginData: GuildPluginData<SpamPluginType>, savedMessage: SavedMessage) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { SavedMessage } from "../../../data/entities/SavedMessage";
|
||||
import moment from "moment-timezone";
|
||||
import { getBaseUrl } from "../../../pluginUtils";
|
||||
import { GuildPluginData } from "knub";
|
||||
import moment from "moment-timezone";
|
||||
import { SavedMessage } from "../../../data/entities/SavedMessage";
|
||||
import { getBaseUrl } from "../../../pluginUtils";
|
||||
import { SpamPluginType } from "../types";
|
||||
|
||||
const SPAM_ARCHIVE_EXPIRY_DAYS = 90;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue