blob: 0cbf95593c12debf580b0f3bfb719309b062e29e [file] [log] [blame]
pineafane625d782022-05-09 18:04:32 +01001import readConfig from "./readConfig.js";
2
3class Memory {
4 memory: {};
5 constructor() {
6 this.memory = {};
7 }
8
9 async readGuildInfo(guild: string): Promise<object> {
10 if (!this.memory[guild]) {
11 let guildData = await readConfig(guild);
12 this.memory[guild] = {
13 filters: guildData.filters,
14 logging: guildData.logging,
15 tickets: guildData.tickets,
16 }; // TODO: REMOVE GUILD FROM MEMORY WHEN THESE UPDATE
pineafan6fb3e072022-05-20 19:27:23 +010017 } // TODO: Add a "lastAccessed" prop, delete after 15 minutes
pineafane625d782022-05-09 18:04:32 +010018 return this.memory[guild];
19 }
20}
21
22export default Memory;