import { Collection, Message, TextChannel } from "discord.js"; import { PrismaClient } from "@prisma/client"; import { BaseEntry, BaseGuildCache } from "../"; /** * A class that assists in the cleaning of a Discord TextChannel. */ export default class ChannelCleaner

> { /** * The GuildCache of the channel's Guild */ private readonly cache; /** * The id of the Channel to clean */ private readonly channelId; /** * The only messages that should be in the Channel */ private readonly messageIds; private excluded; private channel?; private readonly messages; constructor( /** * The GuildCache of the channel's Guild */ cache: GC, /** * The id of the Channel to clean */ channelId: string, /** * The only messages that should be in the Channel */ messageIds: string[]); /** * Set a filter to remove messages that meet a condition. * TRUE if excluding message from deletion * * @param excluded Filter */ setExcluded(excluded: (message: Message) => boolean): this; /** * Begins the cleaning of the channel */ clean(): Promise; /** * Gets the TextChannel that was cleaned * * @throws Error if the {@link clean} method has not been called and awaited yet * @returns The Channel that was cleaned */ getChannel(): TextChannel; /** * Gets the messageIds before or after the cleaning * * @returns The messageIds before or after the cleaning */ getMessageIds(): string[]; /** * Gets the collection of messages before or after the cleaning * * @returns The collection of messages before or after the cleaning */ getMessages(): Collection>; }