Organise all imports, make Mutes depend on Logs

This commit is contained in:
Dark 2021-06-06 23:51:32 +02:00
parent a94e7593ec
commit 6ac9d2f2a2
No known key found for this signature in database
GPG key ID: 2CD6ACB6B0A87B8A
437 changed files with 1912 additions and 2027 deletions

View file

@ -1,14 +1,13 @@
import { utilityCmd } from "../types";
import { EmbedWith, multiSorter, resolveMember, sorter } from "../../../utils";
import { getCurrentUptime } from "../../../uptime";
import { GuildChannel, MessageOptions } from "discord.js";
import humanizeDuration from "humanize-duration";
import LCL from "last-commit-log";
import path from "path";
import moment from "moment-timezone";
import { rootDir } from "../../../paths";
import { getCurrentUptime } from "../../../uptime";
import { EmbedWith, multiSorter, resolveMember, sorter } from "../../../utils";
import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin";
import { GuildChannel, MessageOptions } from "discord.js";
import { utilityCmd } from "../types";
export const AboutCmd = utilityCmd({
trigger: "about",

View file

@ -1,8 +1,8 @@
import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { UnknownUser } from "../../../utils";
import { sendErrorMessage } from "../../../pluginUtils";
import { MessageEmbedOptions } from "discord.js";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { sendErrorMessage } from "../../../pluginUtils";
import { UnknownUser } from "../../../utils";
import { utilityCmd } from "../types";
export const AvatarCmd = utilityCmd({
trigger: ["avatar", "av"],

View file

@ -1,6 +1,6 @@
import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { archiveSearch, displaySearch, SearchType } from "../search";
import { utilityCmd } from "../types";
// Separate from BanSearchCmd to avoid a circular reference from ./search.ts
export const banSearchSignature = {

View file

@ -1,7 +1,7 @@
import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { sendErrorMessage } from "../../../pluginUtils";
import { getChannelInfoEmbed } from "../functions/getChannelInfoEmbed";
import { utilityCmd } from "../types";
export const ChannelInfoCmd = utilityCmd({
trigger: ["channel", "channelinfo"],

View file

@ -1,15 +1,15 @@
import { utilityCmd, UtilityPluginType } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { DAYS, getInviteCodesInString, noop, SECONDS, stripObjectToScalars } from "../../../utils";
import { getBaseUrl, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
import moment from "moment-timezone";
import { Message, TextChannel, User } from "discord.js";
import { GuildPluginData } from "knub";
import moment from "moment-timezone";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { SavedMessage } from "../../../data/entities/SavedMessage";
import { LogType } from "../../../data/LogType";
import { allowTimeout } from "../../../RegExpRunner";
import { ModActionsPlugin } from "../../../plugins/ModActions/ModActionsPlugin";
import { TextChannel, User, Message } from "discord.js";
import { getBaseUrl, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
import { allowTimeout } from "../../../RegExpRunner";
import { DAYS, getInviteCodesInString, noop, SECONDS, stripObjectToScalars } from "../../../utils";
import { utilityCmd, UtilityPluginType } from "../types";
const MAX_CLEAN_COUNT = 150;
const MAX_CLEAN_TIME = 1 * DAYS;

View file

@ -1,10 +1,10 @@
import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { messageLink } from "../../../utils";
import { sendErrorMessage } from "../../../pluginUtils";
import { canReadChannel } from "../../../utils/canReadChannel";
import { TextChannel } from "discord.js";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { sendErrorMessage } from "../../../pluginUtils";
import { messageLink } from "../../../utils";
import { canReadChannel } from "../../../utils/canReadChannel";
import { utilityCmd } from "../types";
export const ContextCmd = utilityCmd({
trigger: "context",

View file

@ -1,8 +1,8 @@
import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { sendErrorMessage } from "../../../pluginUtils";
import { customEmojiRegex } from "../../../utils";
import { getEmojiInfoEmbed } from "../functions/getEmojiInfoEmbed";
import { utilityCmd } from "../types";
export const EmojiInfoCmd = utilityCmd({
trigger: ["emoji", "emojiinfo"],

View file

@ -1,8 +1,8 @@
import { utilityCmd } from "../types";
import { LoadedGuildPlugin } from "knub";
import { PluginCommandDefinition } from "knub/dist/commands/commandUtils";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { createChunkedMessage } from "../../../utils";
import { PluginCommandDefinition } from "knub/dist/commands/commandUtils";
import { LoadedGuildPlugin } from "knub";
import { utilityCmd } from "../types";
export const HelpCmd = utilityCmd({
trigger: "help",

View file

@ -1,19 +1,19 @@
import { utilityCmd } from "../types";
import { getChannelId, getRoleId } from "knub/dist/utils";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { sendErrorMessage } from "../../../pluginUtils";
import { getInviteInfoEmbed } from "../functions/getInviteInfoEmbed";
import { customEmojiRegex, isValidSnowflake, parseInviteCodeInput, resolveInvite, resolveUser } from "../../../utils";
import { getUserInfoEmbed } from "../functions/getUserInfoEmbed";
import { resolveMessageTarget } from "../../../utils/resolveMessageTarget";
import { canReadChannel } from "../../../utils/canReadChannel";
import { getMessageInfoEmbed } from "../functions/getMessageInfoEmbed";
import { resolveMessageTarget } from "../../../utils/resolveMessageTarget";
import { getChannelInfoEmbed } from "../functions/getChannelInfoEmbed";
import { getServerInfoEmbed } from "../functions/getServerInfoEmbed";
import { getChannelId, getRoleId } from "knub/dist/utils";
import { getGuildPreview } from "../functions/getGuildPreview";
import { getSnowflakeInfoEmbed } from "../functions/getSnowflakeInfoEmbed";
import { getRoleInfoEmbed } from "../functions/getRoleInfoEmbed";
import { getEmojiInfoEmbed } from "../functions/getEmojiInfoEmbed";
import { getGuildPreview } from "../functions/getGuildPreview";
import { getInviteInfoEmbed } from "../functions/getInviteInfoEmbed";
import { getMessageInfoEmbed } from "../functions/getMessageInfoEmbed";
import { getRoleInfoEmbed } from "../functions/getRoleInfoEmbed";
import { getServerInfoEmbed } from "../functions/getServerInfoEmbed";
import { getSnowflakeInfoEmbed } from "../functions/getSnowflakeInfoEmbed";
import { getUserInfoEmbed } from "../functions/getUserInfoEmbed";
import { utilityCmd } from "../types";
export const InfoCmd = utilityCmd({
trigger: "info",

View file

@ -1,8 +1,8 @@
import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { sendErrorMessage } from "../../../pluginUtils";
import { getInviteInfoEmbed } from "../functions/getInviteInfoEmbed";
import { parseInviteCodeInput } from "../../../utils";
import { getInviteInfoEmbed } from "../functions/getInviteInfoEmbed";
import { utilityCmd } from "../types";
export const InviteInfoCmd = utilityCmd({
trigger: ["invite", "inviteinfo"],

View file

@ -1,10 +1,10 @@
import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { downloadFile, isEmoji, SECONDS } from "../../../utils";
import fs from "fs";
import sharp from "sharp";
import twemoji from "twemoji";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { sendErrorMessage } from "../../../pluginUtils";
import { downloadFile, isEmoji, SECONDS } from "../../../utils";
import { utilityCmd } from "../types";
const fsp = fs.promises;

View file

@ -1,6 +1,6 @@
import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { helpers } from "knub";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { utilityCmd } from "../types";
const { getMemberLevel } = helpers;

View file

@ -1,8 +1,8 @@
import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { sendErrorMessage } from "../../../pluginUtils";
import { getMessageInfoEmbed } from "../functions/getMessageInfoEmbed";
import { canReadChannel } from "../../../utils/canReadChannel";
import { getMessageInfoEmbed } from "../functions/getMessageInfoEmbed";
import { utilityCmd } from "../types";
export const MessageInfoCmd = utilityCmd({
trigger: ["message", "messageinfo"],

View file

@ -1,7 +1,7 @@
import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { errorMessage } from "../../../utils";
import { canActOn, sendSuccessMessage } from "../../../pluginUtils";
import { errorMessage } from "../../../utils";
import { utilityCmd } from "../types";
export const NicknameCmd = utilityCmd({
trigger: ["nickname", "nick"],

View file

@ -1,7 +1,7 @@
import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { errorMessage } from "../../../utils";
import { canActOn, sendSuccessMessage } from "../../../pluginUtils";
import { errorMessage } from "../../../utils";
import { utilityCmd } from "../types";
export const NicknameResetCmd = utilityCmd({
trigger: ["nickname reset", "nick reset"],

View file

@ -1,6 +1,6 @@
import { utilityCmd } from "../types";
import { noop, trimLines } from "../../../utils";
import { Message } from "discord.js";
import { noop, trimLines } from "../../../utils";
import { utilityCmd } from "../types";
const { performance } = require("perf_hooks");

View file

@ -1,7 +1,7 @@
import { TextChannel } from "discord.js";
import { activeReloads } from "../guildReloads";
import { utilityCmd } from "../types";
import { activeReloads } from "../guildReloads";
import { TextChannel } from "discord.js";
export const ReloadGuildCmd = utilityCmd({
trigger: "reload_guild",

View file

@ -1,7 +1,6 @@
import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { sendErrorMessage } from "../../../pluginUtils";
import { getRoleInfoEmbed } from "../functions/getRoleInfoEmbed";
import { utilityCmd } from "../types";
export const RoleInfoCmd = utilityCmd({
trigger: ["roleinfo"],

View file

@ -1,10 +1,10 @@
import { utilityCmd } from "../types";
import { Role, TextChannel } from "discord.js";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { sendErrorMessage } from "../../../pluginUtils";
import { chunkArray, sorter, trimLines } from "../../../utils";
import { refreshMembersIfNeeded } from "../refreshMembers";
import { sendErrorMessage } from "../../../pluginUtils";
import { Role, TextChannel } from "discord.js";
import { utilityCmd } from "../types";
export const RolesCmd = utilityCmd({
trigger: "roles",

View file

@ -1,6 +1,6 @@
import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { archiveSearch, displaySearch, SearchType } from "../search";
import { utilityCmd } from "../types";
// Separate from SearchCmd to avoid a circular reference from ./search.ts
export const searchCmdSignature = {

View file

@ -1,7 +1,7 @@
import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { sendErrorMessage } from "../../../pluginUtils";
import { getServerInfoEmbed } from "../functions/getServerInfoEmbed";
import { utilityCmd } from "../types";
export const ServerInfoCmd = utilityCmd({
trigger: ["server", "serverinfo"],

View file

@ -1,8 +1,6 @@
import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { sendErrorMessage } from "../../../pluginUtils";
import { getChannelInfoEmbed } from "../functions/getChannelInfoEmbed";
import { getSnowflakeInfoEmbed } from "../functions/getSnowflakeInfoEmbed";
import { utilityCmd } from "../types";
export const SnowflakeInfoCmd = utilityCmd({
trigger: ["snowflake", "snowflakeinfo"],

View file

@ -1,10 +1,9 @@
import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { errorMessage } from "../../../utils";
import { getBaseUrl, sendErrorMessage } from "../../../pluginUtils";
import moment from "moment-timezone";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { getBaseUrl, sendErrorMessage } from "../../../pluginUtils";
import { canReadChannel } from "../../../utils/canReadChannel";
import { utilityCmd } from "../types";
export const SourceCmd = utilityCmd({
trigger: "source",

View file

@ -1,7 +1,7 @@
import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { getUserInfoEmbed } from "../functions/getUserInfoEmbed";
import { sendErrorMessage } from "../../../pluginUtils";
import { getUserInfoEmbed } from "../functions/getUserInfoEmbed";
import { utilityCmd } from "../types";
export const UserInfoCmd = utilityCmd({
trigger: ["user", "userinfo", "whois"],

View file

@ -1,16 +1,12 @@
import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import {
channelMentionRegex,
errorMessage,
isSnowflake,
simpleClosestStringMatch,
stripObjectToScalars,
} from "../../../utils";
import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
import { LogType } from "../../../data/LogType";
import { VoiceChannel } from "discord.js";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { LogType } from "../../../data/LogType";
import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
import {
stripObjectToScalars
} from "../../../utils";
import { utilityCmd } from "../types";
export const VcdisconnectCmd = utilityCmd({
trigger: ["vcdisconnect", "vcdisc", "vcdc", "vckick", "vck"],

View file

@ -1,17 +1,17 @@
import { utilityCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import {
channelMentionRegex,
errorMessage,
isSnowflake,
resolveMember,
simpleClosestStringMatch,
stripObjectToScalars,
} from "../../../utils";
import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
import { LogType } from "../../../data/LogType";
import { VoiceChannel } from "discord.js";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { LogType } from "../../../data/LogType";
import { canActOn, sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
import {
channelMentionRegex,
isSnowflake,
simpleClosestStringMatch,
stripObjectToScalars
} from "../../../utils";
import { utilityCmd } from "../types";
export const VcmoveCmd = utilityCmd({
trigger: "vcmove",