diff --git a/src/utils/eventScheduler.ts b/src/utils/eventScheduler.ts
index df46ca8..6923ede 100644
--- a/src/utils/eventScheduler.ts
+++ b/src/utils/eventScheduler.ts
@@ -2,13 +2,18 @@
 import client from "./client.js";
 import * as fs from "fs";
 import * as path from "path";
-import config from "../config/main.json" assert {type: "json"};
+import config from "../config/main.json" assert { type: "json" };
 
 class EventScheduler {
     private agenda: Agenda;
 
     constructor() {
-        this.agenda = new Agenda({db: {address: config.mongoUrl + "Nucleus", collection: "eventScheduler"}});
+        this.agenda = new Agenda({
+            db: {
+                address: config.mongoUrl + "Nucleus",
+                collection: "eventScheduler"
+            }
+        });
 
         this.agenda.define("unmuteRole", async (job) => {
             const guild = await client.guilds.fetch(job.attrs.data.guild);
@@ -18,17 +23,31 @@
             await job.remove();
         });
         this.agenda.define("deleteFile", async (job) => {
-            fs.rm(path.resolve("dist/utils/temp", job.attrs.data.fileName), client._error);
+            fs.rm(
+                path.resolve("dist/utils/temp", job.attrs.data.fileName),
+                client._error
+            );
             await job.remove();
         });
         this.agenda.define("naturalUnmute", async (job) => {
-            const { log, NucleusColors, entry, renderUser, renderDelta } = client.logger;
+            const { log, NucleusColors, entry, renderUser, renderDelta } =
+                client.logger;
             const guild = await client.guilds.fetch(job.attrs.data.guild);
             const user = await guild.members.fetch(job.attrs.data.user);
             if (user.communicationDisabledUntil === null) return;
-            try { await client.database.history.create(
-                "unmute", user.guild.id, user.user, null, null, null, null
-            );} catch (e) { client._error(e); }
+            try {
+                await client.database.history.create(
+                    "unmute",
+                    user.guild.id,
+                    user.user,
+                    null,
+                    null,
+                    null,
+                    null
+                );
+            } catch (e) {
+                client._error(e);
+            }
             const data = {
                 meta: {
                     type: "memberUnmute",
@@ -41,7 +60,10 @@
                 list: {
                     memberId: entry(user.user.id, `\`${user.user.id}\``),
                     name: entry(user.user.id, renderUser(user.user)),
-                    unmuted: entry(new Date().getTime(), renderDelta(new Date().getTime())),
+                    unmuted: entry(
+                        new Date().getTime(),
+                        renderDelta(new Date().getTime())
+                    ),
                     unmutedBy: entry(null, "*Time out ended*")
                 },
                 hidden: {
@@ -53,7 +75,7 @@
     }
 
     async start() {
-        await new Promise(resolve => this.agenda.once("ready", resolve));
+        await new Promise((resolve) => this.agenda.once("ready", resolve));
         this.agenda.start();
         return this;
     }
@@ -65,8 +87,8 @@
 
     // eslint-disable-next-line @typescript-eslint/no-explicit-any
     cancel(name: string, data: any) {
-        this.agenda.cancel({name, data});
+        this.agenda.cancel({ name, data });
     }
 }
 
-export default EventScheduler;
\ No newline at end of file
+export default EventScheduler;
