3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-07-08 03:27:20 +00:00

chore: format

This commit is contained in:
Dragory 2025-05-31 18:19:26 +00:00
parent 6c55b98eee
commit aaf4e02c5f
No known key found for this signature in database
56 changed files with 282 additions and 255 deletions

View file

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

View file

@ -1,6 +1,7 @@
import { Snowflake } from "discord.js";
import { getChannelId, getRoleId } from "knub/helpers";
import { commandTypeHelpers as ct } from "../../../commandTypes.js";
import { resolveMessageMember } from "../../../pluginUtils.js";
import { isValidSnowflake, noop, parseInviteCodeInput, resolveInvite, resolveUser } from "../../../utils.js";
import { canReadChannel } from "../../../utils/canReadChannel.js";
import { resolveMessageTarget } from "../../../utils/resolveMessageTarget.js";
@ -15,7 +16,6 @@ import { getServerInfoEmbed } from "../functions/getServerInfoEmbed.js";
import { getSnowflakeInfoEmbed } from "../functions/getSnowflakeInfoEmbed.js";
import { getUserInfoEmbed } from "../functions/getUserInfoEmbed.js";
import { utilityCmd } from "../types.js";
import { resolveMessageMember } from "../../../pluginUtils.js";
export const InfoCmd = utilityCmd({
trigger: "info",

View file

@ -1,11 +1,11 @@
import { GuildPluginData } from "knub";
import { UtilityPluginType } from "../types.js";
import { GuildBasedChannel, Snowflake, TextBasedChannel, User } from "discord.js";
import { GuildPluginData } from "knub";
import { SavedMessage } from "../../../data/entities/SavedMessage.js";
import { LogType } from "../../../data/LogType.js";
import { chunkArray } from "../../../utils.js";
import { getBaseUrl } from "../../../pluginUtils.js";
import { chunkArray } from "../../../utils.js";
import { LogsPlugin } from "../../Logs/LogsPlugin.js";
import { UtilityPluginType } from "../types.js";
export async function cleanMessages(
pluginData: GuildPluginData<UtilityPluginType>,

View file

@ -1,11 +1,11 @@
import { GuildBasedChannel, Message, OmitPartialGroupDMChannel, Snowflake, TextBasedChannel } from "discord.js";
import { DAYS, getInviteCodesInString } from "../../../utils.js";
import { GuildPluginData } from "knub";
import { UtilityPluginType } from "../types.js";
import { snowflakeToTimestamp } from "../../../utils/snowflakeToTimestamp.js";
import { SavedMessage } from "../../../data/entities/SavedMessage.js";
import { humanizeDurationShort } from "../../../humanizeDuration.js";
import { allowTimeout } from "../../../RegExpRunner.js";
import { SavedMessage } from "../../../data/entities/SavedMessage.js";
import { DAYS, getInviteCodesInString } from "../../../utils.js";
import { snowflakeToTimestamp } from "../../../utils/snowflakeToTimestamp.js";
import { UtilityPluginType } from "../types.js";
const MAX_CLEAN_COUNT = 300;
const MAX_CLEAN_TIME = 1 * DAYS;
@ -33,7 +33,11 @@ export interface ErrorResult {
export type FetchChannelMessagesToCleanResult = SuccessResult | ErrorResult;
export async function fetchChannelMessagesToClean(pluginData: GuildPluginData<UtilityPluginType>, targetChannel: GuildBasedChannel & TextBasedChannel, opts: FetchChannelMessagesToCleanOpts): Promise<FetchChannelMessagesToCleanResult> {
export async function fetchChannelMessagesToClean(
pluginData: GuildPluginData<UtilityPluginType>,
targetChannel: GuildBasedChannel & TextBasedChannel,
opts: FetchChannelMessagesToCleanOpts,
): Promise<FetchChannelMessagesToCleanResult> {
if (opts.count > MAX_CLEAN_COUNT || opts.count <= 0) {
return { error: `Clean count must be between 1 and ${MAX_CLEAN_COUNT}` };
}
@ -75,7 +79,10 @@ export async function fetchChannelMessagesToClean(pluginData: GuildPluginData<Ut
break;
}
if (message.createdTimestamp < timestampCutoff) continue;
if (opts.matchContent && !(await pluginData.state.regexRunner.exec(opts.matchContent, contentString).catch(allowTimeout))) {
if (
opts.matchContent &&
!(await pluginData.state.regexRunner.exec(opts.matchContent, contentString).catch(allowTimeout))
) {
continue;
}

View file

@ -2,7 +2,6 @@ import { APIEmbed, ChannelType } from "discord.js";
import { GuildPluginData } from "knub";
import {
EmbedWith,
GroupDMInvite,
formatNumber,
inviteHasCounts,
isGroupDMInvite,