mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-12 21:05: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,7 +1,7 @@
|
|||
import { AutomodContext, AutomodPluginType } from "../types";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { RECENT_ACTION_EXPIRY_TIME, RecentActionType } from "../constants";
|
||||
import { getEmojiInString, getRoleMentions, getUrlsInString, getUserMentions } from "../../../utils";
|
||||
import { RecentActionType, RECENT_ACTION_EXPIRY_TIME } from "../constants";
|
||||
import { AutomodContext, AutomodPluginType } from "../types";
|
||||
|
||||
export function addRecentActionsFromMessage(pluginData: GuildPluginData<AutomodPluginType>, context: AutomodContext) {
|
||||
const message = context.message!;
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import { AutomodContext, AutomodPluginType, TRule } from "../types";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { AutomodTriggerMatchResult } from "../helpers";
|
||||
import { convertDelayStringToMS } from "../../../utils";
|
||||
import { AutomodContext, AutomodPluginType, TRule } from "../types";
|
||||
|
||||
export function checkAndUpdateCooldown(
|
||||
pluginData: GuildPluginData<AutomodPluginType>,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import { RECENT_NICKNAME_CHANGE_EXPIRY_TIME } from "../constants";
|
||||
import { AutomodPluginType } from "../types";
|
||||
import { RECENT_NICKNAME_CHANGE_EXPIRY_TIME, RECENT_SPAM_EXPIRY_TIME } from "../constants";
|
||||
|
||||
export function clearOldRecentNicknameChanges(pluginData: GuildPluginData<AutomodPluginType>) {
|
||||
const now = Date.now();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import { AutomodPluginType } from "../types";
|
||||
import { RECENT_ACTION_EXPIRY_TIME } from "../constants";
|
||||
import { AutomodPluginType } from "../types";
|
||||
|
||||
export function clearOldRecentActions(pluginData: GuildPluginData<AutomodPluginType>) {
|
||||
const now = Date.now();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import { AutomodPluginType } from "../types";
|
||||
import { RECENT_SPAM_EXPIRY_TIME } from "../constants";
|
||||
import { AutomodPluginType } from "../types";
|
||||
|
||||
export function clearOldRecentSpam(pluginData: GuildPluginData<AutomodPluginType>) {
|
||||
const now = Date.now();
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
import { AutomodContext, AutomodPluginType } from "../types";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { RECENT_ACTION_EXPIRY_TIME, RecentActionType } from "../constants";
|
||||
import { getEmojiInString, getRoleMentions, getUrlsInString, getUserMentions } from "../../../utils";
|
||||
import { AutomodContext, AutomodPluginType } from "../types";
|
||||
|
||||
export function clearRecentActionsForMessage(pluginData: GuildPluginData<AutomodPluginType>, context: AutomodContext) {
|
||||
const message = context.message!;
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import { RecentActionType } from "../constants";
|
||||
import { automodTrigger } from "../helpers";
|
||||
import * as t from "io-ts";
|
||||
import { SavedMessage } from "../../../data/entities/SavedMessage";
|
||||
import { humanizeDurationShort } from "../../../humanizeDurationShort";
|
||||
import { getBaseUrl } from "../../../pluginUtils";
|
||||
import { convertDelayStringToMS, sorter, tDelayString, tNullable } from "../../../utils";
|
||||
import { humanizeDurationShort } from "../../../humanizeDurationShort";
|
||||
import { RecentActionType } from "../constants";
|
||||
import { automodTrigger } from "../helpers";
|
||||
import { findRecentSpam } from "./findRecentSpam";
|
||||
import { getMatchingMessageRecentActions } from "./getMatchingMessageRecentActions";
|
||||
import * as t from "io-ts";
|
||||
import { getMessageSpamIdentifier } from "./getSpamIdentifier";
|
||||
import { SavedMessage } from "../../../data/entities/SavedMessage";
|
||||
|
||||
const MessageSpamTriggerConfig = t.type({
|
||||
amount: t.number,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import { AutomodPluginType } from "../types";
|
||||
import { RecentActionType } from "../constants";
|
||||
import { AutomodPluginType } from "../types";
|
||||
|
||||
export function findRecentSpam(
|
||||
pluginData: GuildPluginData<AutomodPluginType>,
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import { AutomodPluginType } from "../types";
|
||||
import { SavedMessage } from "../../../data/entities/SavedMessage";
|
||||
import moment from "moment-timezone";
|
||||
import { getMatchingRecentActions } from "./getMatchingRecentActions";
|
||||
import { SavedMessage } from "../../../data/entities/SavedMessage";
|
||||
import { RecentActionType } from "../constants";
|
||||
import { AutomodPluginType } from "../types";
|
||||
import { getMatchingRecentActions } from "./getMatchingRecentActions";
|
||||
|
||||
export function getMatchingMessageRecentActions(
|
||||
pluginData: GuildPluginData<AutomodPluginType>,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import { AutomodPluginType } from "../types";
|
||||
import { RecentActionType } from "../constants";
|
||||
import { AutomodPluginType } from "../types";
|
||||
|
||||
export function getMatchingRecentActions(
|
||||
pluginData: GuildPluginData<AutomodPluginType>,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import { MatchableTextType } from "./matchMultipleTextTypesOnMessage";
|
||||
import { AutomodContext, AutomodPluginType } from "../types";
|
||||
import { messageSummary, verboseChannelMention } from "../../../utils";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { messageSummary, verboseChannelMention } from "../../../utils";
|
||||
import { AutomodContext, AutomodPluginType } from "../types";
|
||||
import { MatchableTextType } from "./matchMultipleTextTypesOnMessage";
|
||||
|
||||
export function getTextMatchPartialSummary(
|
||||
pluginData: GuildPluginData<AutomodPluginType>,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import { AutomodPluginType } from "../types";
|
||||
import { MINUTES } from "../../../utils";
|
||||
import { AutomodPluginType } from "../types";
|
||||
|
||||
const IGNORED_ROLE_CHANGE_LIFETIME = 5 * MINUTES;
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { Constants } from "discord.js";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { SavedMessage } from "../../../data/entities/SavedMessage";
|
||||
import { resolveMember } from "../../../utils";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { AutomodPluginType } from "../types";
|
||||
import { Activity, Constants } from "discord.js";
|
||||
|
||||
type TextTriggerWithMultipleMatchTypes = {
|
||||
match_messages: boolean;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { disableUserNotificationStrings, UserNotificationMethod } from "../../../utils";
|
||||
import { ERRORS, RecoverablePluginError } from "../../../RecoverablePluginError";
|
||||
|
||||
import { GuildPluginData } from "knub";
|
||||
import { AutomodPluginType } from "../types";
|
||||
import { TextChannel } from "discord.js";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { ERRORS, RecoverablePluginError } from "../../../RecoverablePluginError";
|
||||
import { disableUserNotificationStrings, UserNotificationMethod } from "../../../utils";
|
||||
import { AutomodPluginType } from "../types";
|
||||
|
||||
|
||||
export function resolveActionContactMethods(
|
||||
pluginData: GuildPluginData<AutomodPluginType>,
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import { AutomodContext, AutomodPluginType } from "../types";
|
||||
import { availableTriggers } from "../triggers/availableTriggers";
|
||||
import { availableActions } from "../actions/availableActions";
|
||||
import { AutomodTriggerMatchResult } from "../helpers";
|
||||
import { CleanAction } from "../actions/clean";
|
||||
import { checkAndUpdateCooldown } from "./checkAndUpdateCooldown";
|
||||
import { TextChannel } from "discord.js";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { availableActions } from "../actions/availableActions";
|
||||
import { CleanAction } from "../actions/clean";
|
||||
import { AutomodTriggerMatchResult } from "../helpers";
|
||||
import { availableTriggers } from "../triggers/availableTriggers";
|
||||
import { AutomodContext, AutomodPluginType } from "../types";
|
||||
import { checkAndUpdateCooldown } from "./checkAndUpdateCooldown";
|
||||
|
||||
export async function runAutomod(pluginData: GuildPluginData<AutomodPluginType>, context: AutomodContext) {
|
||||
const userId = context.user?.id || context.member?.id || context.message?.user_id;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { User } from "discord.js";
|
||||
import { GuildPluginData } from "knub";
|
||||
import { AutomodPluginType } from "../types";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { LogType } from "../../../data/LogType";
|
||||
import { stripObjectToScalars } from "../../../utils";
|
||||
import { LogsPlugin } from "../../Logs/LogsPlugin";
|
||||
import { runAutomodOnAntiraidLevel } from "../events/runAutomodOnAntiraidLevel";
|
||||
import { User } from "discord.js";
|
||||
import { AutomodPluginType } from "../types";
|
||||
|
||||
export async function setAntiraidLevel(
|
||||
pluginData: GuildPluginData<AutomodPluginType>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue