diff --git a/src/Unfinished/categorizationTest.ts b/src/Unfinished/categorizationTest.ts
index 763669c..dfe9098 100644
--- a/src/Unfinished/categorizationTest.ts
+++ b/src/Unfinished/categorizationTest.ts
@@ -51,7 +51,6 @@
         let channel: string | GuildChannel;
         if (typeof c === "string") channel = interaction.guild!.channels.cache.get(c as string)!.id;
         else channel = (c[0] as unknown as GuildChannel).id;
-        console.log(channel);
         if (!predicted[channel]) predicted[channel] = [];
         m = await interaction.editReply({
             embeds: [
@@ -139,7 +138,6 @@
         }
         categorized[channel] = selected;
     }
-    console.log(categorized);
 };
 
 const check = () => {
diff --git a/src/commands/nucleus/premium.ts b/src/commands/nucleus/premium.ts
index f544045..fed2964 100644
--- a/src/commands/nucleus/premium.ts
+++ b/src/commands/nucleus/premium.ts
@@ -93,8 +93,7 @@
         if (i.isButton()) {
             closed = true;
         } else {
-            const response = await client.database.premium.removePremium(interaction.user.id, i.values[0]!);
-            console.log(response);
+            await client.database.premium.removePremium(interaction.user.id, i.values[0]!);
         }
     } while (!closed);
     await interaction.deleteReply();
diff --git a/src/commands/settings/moderation.ts b/src/commands/settings/moderation.ts
index 6ee6e1e..4d850a9 100644
--- a/src/commands/settings/moderation.ts
+++ b/src/commands/settings/moderation.ts
@@ -29,7 +29,6 @@
     while (!timedOut) {
         const config = await client.database.guilds.read(interaction.guild!.id);
         const moderation = config.moderation;
-        console.log(moderation);
         await interaction.editReply({
             embeds: [
                 new EmojiEmbed()
diff --git a/src/commands/settings/tracks.ts b/src/commands/settings/tracks.ts
index b79f54d..e608f31 100644
--- a/src/commands/settings/tracks.ts
+++ b/src/commands/settings/tracks.ts
@@ -472,9 +472,7 @@
                     const newPage = await editTrack(i, m, roles);
                     if (_.isEqual(newPage, defaultTrackData)) break;
                     if (!newPage) break;
-                    console.log(newPage);
                     tracks.push(newPage);
-                    console.log(tracks);
                     page = tracks.length - 1;
                     break;
                 }
diff --git a/src/context/users/userinfo.ts b/src/context/users/userinfo.ts
index 7a75754..9c7433f 100644
--- a/src/context/users/userinfo.ts
+++ b/src/context/users/userinfo.ts
@@ -4,7 +4,6 @@
 const command = new ContextMenuCommandBuilder().setName("User info");
 
 const callback = async (interaction: UserContextMenuCommandInteraction) => {
-    console.log("callback");
     const guild = interaction.guild!;
     let member = interaction.targetMember;
     if (!member) member = await guild.members.fetch(interaction.targetId);
@@ -12,7 +11,6 @@
 };
 
 const check = async (_interaction: UserContextMenuCommandInteraction) => {
-    console.log("check");
     return true;
 };
 
diff --git a/src/reflex/scanners.ts b/src/reflex/scanners.ts
index 1b9d740..6d3fc71 100644
--- a/src/reflex/scanners.ts
+++ b/src/reflex/scanners.ts
@@ -52,7 +52,6 @@
 
     const predictions = (await nsfw_model.classify(img, 1))[0]!;
     img.dispose();
-    console.log(2, predictions);
 
     const nsfw = predictions.className === "Hentai" || predictions.className === "Porn";
     await client.database.scanCache.write(hash, "nsfw", nsfw);
@@ -204,7 +203,6 @@
         oem: 1,
         psm: 3
     });
-    console.log(text);
     return text;
 }
 
diff --git a/src/utils/database.ts b/src/utils/database.ts
index 5386f7f..3121d06 100644
--- a/src/utils/database.ts
+++ b/src/utils/database.ts
@@ -268,7 +268,6 @@
             .replace(/=/g, "")
             .replace(/\//g, "_")
             .replace(/\+/g, "-");
-        console.log(iv);
         for (const message of transcript.messages) {
             if (message.content) {
                 const encCipher = crypto.createCipheriv("AES-256-CBC", key, iv);
@@ -337,10 +336,8 @@
     }
 
     async read(code: string, key: string, iv: string) {
-        console.log("Transcript read");
         let doc: TranscriptSchema | null = await this.transcripts.findOne({ code: code });
         let findDoc: findDocSchema | null = null;
-        console.log(doc);
         if (!doc) findDoc = await this.messageToTranscript.findOne({ transcript: code });
         if (findDoc) {
             const message = await (
@@ -366,7 +363,6 @@
             if (!data) return null;
             doc = JSON.parse(Buffer.from(data).toString()) as TranscriptSchema;
         }
-        console.log(doc);
         if (!doc) return null;
         for (const message of doc.messages) {
             if (message.content) {
diff --git a/src/utils/log.ts b/src/utils/log.ts
index 8c8c0c9..3b6048a 100644
--- a/src/utils/log.ts
+++ b/src/utils/log.ts
@@ -99,9 +99,7 @@
     },
     async log(log: LoggerOptions): Promise<void> {
         if (!(await isLogging(log.hidden.guild, log.meta.calculateType))) return;
-        console.log(log.hidden.guild);
         const config = await client.database.guilds.read(log.hidden.guild);
-        console.log(config.logging.logs.channel);
 
         if (config.logging.logs.channel) {
             const channel = (await client.channels.fetch(config.logging.logs.channel)) as Discord.TextChannel | null;
