diff --git a/src/utils/database.ts b/src/utils/database.ts
index c7b1777..c85b43a 100644
--- a/src/utils/database.ts
+++ b/src/utils/database.ts
@@ -1,6 +1,7 @@
 import type Discord from "discord.js";
 import { Collection, MongoClient } from "mongodb";
 import config from "../config/main.json" assert { type: "json" };
+import client from "../utils/client.js";
 
 const mongoClient = new MongoClient(config.mongoUrl);
 await mongoClient.connect();
@@ -230,18 +231,55 @@
         this.premium = database.collection<PremiumSchema>("premium");
     }
 
+    async updateUser(user: string, level: number) {
+        if(!(await this.userExists(user))) await this.createUser(user, level);
+        await this.premium.updateOne({ user: user }, { $set: { level: level } }, { upsert: true });
+    }
+
+    async userExists(user: string): Promise<boolean> {
+        const entry = await this.premium.findOne({ user: user });
+        return entry ? true : false;
+    }
+
+    async createUser(user: string, level: number) {
+        await this.premium.insertOne({ user: user, appliesTo: [], level: level });
+    }
+
     async hasPremium(guild: string) {
         const entry = await this.premium.findOne({
             appliesTo: { $in: [guild] }
         });
-        if (!entry) return false;
-        return entry.expires.valueOf() > Date.now();
+        return entry ? true : false;
     }
 
-    async fetchTotal(user: string): Promise<number> {
+    async fetchUser(user: string): Promise<PremiumSchema | null> {
         const entry = await this.premium.findOne({ user: user });
-        if (!entry) return 0;
-        return entry.appliesTo.length;
+        if (!entry) return null;
+        return entry;
+    }
+
+    async checkAllPremium() {
+        const entries = await this.premium.find({}).toArray();
+        for(const {user, expiresAt} of entries) {
+            if(expiresAt) expiresAt < new Date().getTime() ? await this.premium.deleteOne({user: user}) : null;
+            const member = await (await client.guilds.fetch("684492926528651336")).members.fetch(user)
+            let level: number = 0;
+            if (member.roles.cache.has("1066468879309750313")) {
+                level = 99;
+            } else if (member.roles.cache.has("1066465491713003520")) {
+                level = 1;
+            } else if (member.roles.cache.has("1066439526496604194")) {
+                level = 2;
+            } else if (member.roles.cache.has("1066464134322978912")) {
+                level = 3;
+            }
+
+            if (level > 0) {
+                await this.updateUser(user, level);
+            } else {
+                await this.premium.updateOne({ user: user }, { expiresAt: (new Date().getTime() + (1000*60*60*24*3)) })
+            }
+        }
     }
 
     addPremium(user: string, guild: string) {
@@ -409,6 +447,6 @@
 export interface PremiumSchema {
     user: string;
     level: number;
-    expires: Date;
     appliesTo: string[];
+    expiresAt?: number;
 }
