Development (#27)
diff --git a/src/utils/database.ts b/src/utils/database.ts
index e867775..5d86275 100644
--- a/src/utils/database.ts
+++ b/src/utils/database.ts
@@ -31,11 +31,19 @@
export class Guilds {
guilds: Collection<GuildConfig>;
+ oldGuilds: Collection<GuildConfig>;
defaultData: GuildConfig;
constructor() {
this.guilds = database.collection<GuildConfig>("guilds");
this.defaultData = defaultData;
+ this.oldGuilds = database.collection<GuildConfig>("oldGuilds");
+ }
+
+ async readOld(guild: string): Promise<Partial<GuildConfig>> {
+ // console.log("Guild read")
+ const entry = await this.oldGuilds.findOne({ id: guild });
+ return entry ?? {};
}
async read(guild: string): Promise<GuildConfig> {