3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-11 04:45:02 +00:00

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,18 +1,18 @@
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
import { PluginOptions } from "knub";
import { ConfigSchema, PostPluginType } from "./types";
import { GuildLogs } from "../../data/GuildLogs";
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
import { GuildScheduledPosts } from "../../data/GuildScheduledPosts";
import { GuildLogs } from "../../data/GuildLogs";
import { PostCmd } from "./commands/PostCmd";
import { PostEmbedCmd } from "./commands/PostEmbedCmd";
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
import { EditCmd } from "./commands/EditCmd";
import { EditEmbedCmd } from "./commands/EditEmbedCmd";
import { ScheduledPostsShowCmd } from "./commands/ScheduledPostsShowCmd";
import { ScheduledPostsListCmd } from "./commands/ScheduledPostsListCmd";
import { PostCmd } from "./commands/PostCmd";
import { PostEmbedCmd } from "./commands/PostEmbedCmd";
import { ScheduledPostsDeleteCmd } from "./commands/SchedluedPostsDeleteCmd";
import { ScheduledPostsListCmd } from "./commands/ScheduledPostsListCmd";
import { ScheduledPostsShowCmd } from "./commands/ScheduledPostsShowCmd";
import { ConfigSchema, PostPluginType } from "./types";
import { scheduledPostLoop } from "./util/scheduledPostLoop";
import { TimeAndDatePlugin } from "../TimeAndDate/TimeAndDatePlugin";
const defaultOptions: PluginOptions<PostPluginType> = {
config: {

View file

@ -1,8 +1,8 @@
import { postCmd } from "../types";
import { TextChannel } from "discord.js";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
import { postCmd } from "../types";
import { formatContent } from "../util/formatContent";
import { TextChannel } from "discord.js";
export const EditCmd = postCmd({
trigger: "edit",

View file

@ -1,12 +1,12 @@
import { postCmd } from "../types";
import { MessageEmbed, TextChannel } from "discord.js";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
import { trimLines } from "../../../utils";
import { formatContent } from "../util/formatContent";
import { parseColor } from "../../../utils/parseColor";
import { rgbToInt } from "../../../utils/rgbToInt";
import { MessageEmbed, TextChannel } from "discord.js";
import { postCmd } from "../types";
import { formatContent } from "../util/formatContent";
const COLOR_MATCH_REGEX = /^#?([0-9a-f]{6})$/;

View file

@ -1,5 +1,5 @@
import { postCmd } from "../types";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { postCmd } from "../types";
import { actualPostCmd } from "../util/actualPostCmd";
export const PostCmd = postCmd({

View file

@ -1,13 +1,13 @@
import { postCmd } from "../types";
import { MessageEmbedOptions } from "discord.js";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { actualPostCmd } from "../util/actualPostCmd";
import { sendErrorMessage } from "../../../pluginUtils";
import { isValidEmbed, trimLines } from "../../../utils";
import { formatContent } from "../util/formatContent";
import { parseColor } from "../../../utils/parseColor";
import { rgbToInt } from "../../../utils/rgbToInt";
import { MessageEmbed, MessageEmbedOptions } from "discord.js";
import { postCmd } from "../types";
import { actualPostCmd } from "../util/actualPostCmd";
import { formatContent } from "../util/formatContent";
export const PostEmbedCmd = postCmd({
trigger: "post_embed",

View file

@ -1,7 +1,7 @@
import { postCmd } from "../types";
import { sorter } from "../../../utils";
import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
import { sorter } from "../../../utils";
import { postCmd } from "../types";
export const ScheduledPostsDeleteCmd = postCmd({
trigger: ["scheduled_posts delete", "scheduled_posts d"],

View file

@ -1,15 +1,11 @@
import { postCmd } from "../types";
import {
trimLines,
sorter,
disableCodeBlocks,
deactivateMentions,
createChunkedMessage,
DBDateFormat,
} from "../../../utils";
import humanizeDuration from "humanize-duration";
import moment from "moment-timezone";
import {
createChunkedMessage,
DBDateFormat, deactivateMentions, disableCodeBlocks, sorter, trimLines
} from "../../../utils";
import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin";
import { postCmd } from "../types";
const SCHEDULED_POST_PREVIEW_TEXT_LENGTH = 50;

View file

@ -1,9 +1,9 @@
import { postCmd } from "../types";
import { sorter } from "../../../utils";
import { sendErrorMessage } from "../../../pluginUtils";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { postMessage } from "../util/postMessage";
import { TextChannel } from "discord.js";
import { commandTypeHelpers as ct } from "../../../commandTypes";
import { sendErrorMessage } from "../../../pluginUtils";
import { sorter } from "../../../utils";
import { postCmd } from "../types";
import { postMessage } from "../util/postMessage";
export const ScheduledPostsShowCmd = postCmd({
trigger: ["scheduled_posts", "scheduled_posts show"],

View file

@ -1,8 +1,8 @@
import * as t from "io-ts";
import { BasePluginType, typedGuildCommand } from "knub";
import { GuildLogs } from "../../data/GuildLogs";
import { GuildSavedMessages } from "../../data/GuildSavedMessages";
import { GuildScheduledPosts } from "../../data/GuildScheduledPosts";
import { GuildLogs } from "../../data/GuildLogs";
export const ConfigSchema = t.type({
can_post: t.boolean,

View file

@ -1,14 +1,14 @@
import { StrictMessageContent, errorMessage, stripObjectToScalars, MINUTES, DBDateFormat } from "../../../utils";
import { Channel, Message, TextChannel } from "discord.js";
import humanizeDuration from "humanize-duration";
import { GuildPluginData } from "knub";
import moment from "moment-timezone";
import { LogType } from "../../../data/LogType";
import humanizeDuration from "humanize-duration";
import { sendErrorMessage, sendSuccessMessage } from "../../../pluginUtils";
import { GuildPluginData } from "knub";
import { DBDateFormat, errorMessage, MINUTES, StrictMessageContent, stripObjectToScalars } from "../../../utils";
import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin";
import { PostPluginType } from "../types";
import { parseScheduleTime } from "./parseScheduleTime";
import { postMessage } from "./postMessage";
import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin";
import { Message, Channel, TextChannel } from "discord.js";
const MIN_REPEAT_TIME = 5 * MINUTES;
const MAX_REPEAT_TIME = Math.pow(2, 32);

View file

@ -1,6 +1,6 @@
import { GuildPluginData } from "knub";
import moment, { Moment } from "moment-timezone";
import { convertDelayStringToMS } from "../../../utils";
import { GuildPluginData } from "knub";
import { TimeAndDatePlugin } from "../../TimeAndDate/TimeAndDatePlugin";
// TODO: Extract out of the Post plugin, use everywhere with a date input

View file

@ -1,10 +1,10 @@
import { GuildPluginData } from "knub";
import { PostPluginType } from "../types";
import { downloadFile } from "../../../utils";
import { Message, MessageAttachment, MessageOptions, TextChannel } from "discord.js";
import fs from "fs";
import { GuildPluginData } from "knub";
import { downloadFile } from "../../../utils";
import { PostPluginType } from "../types";
import { formatContent } from "./formatContent";
import { TextChannel, Message, MessageOptions, MessageAttachment } from "discord.js";
const fsp = fs.promises;

View file

@ -1,12 +1,12 @@
import { GuildPluginData } from "knub";
import { PostPluginType } from "../types";
import { logger } from "../../../logger";
import { stripObjectToScalars, SECONDS, DBDateFormat } from "../../../utils";
import { LogType } from "../../../data/LogType";
import moment from "moment-timezone";
import { postMessage } from "./postMessage";
import { TextChannel, User } from "discord.js";
import { GuildPluginData } from "knub";
import moment from "moment-timezone";
import { LogType } from "../../../data/LogType";
import { logger } from "../../../logger";
import { DBDateFormat, SECONDS, stripObjectToScalars } from "../../../utils";
import { PostPluginType } from "../types";
import { postMessage } from "./postMessage";
const SCHEDULED_POST_CHECK_INTERVAL = 5 * SECONDS;