import { Client, Guild } from "discord.js"; import { PrismaClient } from "@prisma/client"; import { BaseEntry, LogManager } from "../"; import { Alias } from "./BaseEntry"; export type iBaseGuildCache

> = new (bot: Client, guild: Guild, prisma: P) => GC; /** * A class containing information related to each Guild. * * Each Guild that the bot is in will have its own GuildCache. */ export default abstract class BaseGuildCache

> { /** * The Discord Client that is used to interact with the Discord API. */ readonly bot: Client; /** * The Discord Guild that this GuildCache is for. */ readonly guild: Guild; readonly prisma: P; /** * The instance of the logger for this Guild */ readonly logger: LogManager; /** * Cached entry value */ entry: E; /** * Command aliases */ aliases: Alias[]; /** * The property determining if the bot has the admin permission in this Guild */ isAdministrator: boolean; constructor( /** * The Discord Client that is used to interact with the Discord API. */ bot: Client, /** * The Discord Guild that this GuildCache is for. */ guild: Guild, prisma: P); /** * The prefix of this Guild */ get prefix(): string | null; /** * Update the entry data * * @param data The data that changed in the entry */ update(data: Partial): Promise; /** * A method that is called when the GuildCache is constructed. */ onConstruct(): void; /** * This method is where the GuildCache's data is refetched from the database. */ abstract refresh(): Promise; /** * A method that is called every minute by the bot */ abstract updateMinutely(): void; /** * Get an empty entry */ abstract getEmptyEntry(): E; }