fixed gitignore
diff --git a/.envrc b/.envrc
new file mode 100644
index 0000000..e31c306
--- /dev/null
+++ b/.envrc
@@ -0,0 +1,4 @@
+if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then
+    source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.1/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs="
+fi
+use flake
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 15a8d7a..c1da375 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -15,12 +15,14 @@
 jobs:
     lint:
         runs-on: ubuntu-latest
+
         steps:
             - uses: actions/checkout@v3
+            - uses: actions/setup-node@v3.6.0
+              with:
+                  node-version: 19.x
             - run: yarn install --immutable
             - name: Compile
               run: yarn build
-            - name: Run eslint
-              uses: mrdivyansh/eslint-action@v1.0.7
-            - name: Run prettier
-              uses: actionsx/prettier@v2
+            - name: Run prettier and eslint
+              run: yarn lint-ci
diff --git a/.gitignore b/.gitignore
index e9a4102..6deb598 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,3 +19,5 @@
 
 ClicksMigratingProblems/oldData/
 ClicksMigratingProblems/oldData copy/
+
+.direnv/
diff --git a/flake.lock b/flake.lock
new file mode 100644
index 0000000..f30c0f6
--- /dev/null
+++ b/flake.lock
@@ -0,0 +1,43 @@
+{
+  "nodes": {
+    "flake-utils": {
+      "locked": {
+        "lastModified": 1676283394,
+        "narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=",
+        "owner": "numtide",
+        "repo": "flake-utils",
+        "rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073",
+        "type": "github"
+      },
+      "original": {
+        "owner": "numtide",
+        "repo": "flake-utils",
+        "type": "github"
+      }
+    },
+    "nixpkgs": {
+      "locked": {
+        "lastModified": 1677852945,
+        "narHash": "sha256-liiVJjkBTuBTAkRW3hrI8MbPD2ImYzwUpa7kvteiKhM=",
+        "owner": "NixOS",
+        "repo": "nixpkgs",
+        "rev": "f5ffd5787786dde3a8bf648c7a1b5f78c4e01abb",
+        "type": "github"
+      },
+      "original": {
+        "owner": "NixOS",
+        "ref": "nixpkgs-unstable",
+        "repo": "nixpkgs",
+        "type": "github"
+      }
+    },
+    "root": {
+      "inputs": {
+        "flake-utils": "flake-utils",
+        "nixpkgs": "nixpkgs"
+      }
+    }
+  },
+  "root": "root",
+  "version": 7
+}
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..c11ea5f
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,14 @@
+{
+  description = "A basic flake with a shell";
+  inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
+  inputs.flake-utils.url = "github:numtide/flake-utils";
+
+  outputs = { self, nixpkgs, flake-utils }:
+    flake-utils.lib.eachDefaultSystem (system: let
+      pkgs = nixpkgs.legacyPackages.${system};
+    in {
+      devShells.default = pkgs.mkShell {
+        packages = [ pkgs.yarn pkgs.nodejs-19_x pkgs.typescript pkgs.act ];
+      };
+    });
+}
diff --git a/package.json b/package.json
index f28878f..153e81e 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,9 @@
     "dependencies": {
         "@discordjs/rest": "^0.2.0-canary.0",
         "@hokify/agenda": "^6.2.12",
+        "@total-typescript/ts-reset": "^0.3.7",
         "@tsconfig/node18-strictest-esm": "^1.0.0",
+        "@types/node": "^18.14.6",
         "@ungap/structured-clone": "^1.0.1",
         "agenda": "^4.3.0",
         "body-parser": "^1.20.0",
@@ -18,7 +20,7 @@
         "node-tesseract-ocr": "^2.2.1",
         "structured-clone": "^0.2.2",
         "systeminformation": "^5.17.3"
-        },
+    },
     "resolutions": {
         "discord-api-types": "0.37.23"
     },
@@ -34,6 +36,7 @@
         "lint": "echo 'Style checking...'; prettier --check .; echo 'Linting...'; eslint src; echo 'To auto-fix everything possible, please run `yarn lint-fix`'; true",
         "lint-fix": "echo 'Fixing eslint issues...'; eslint src --fix; echo 'Reformatting...'; prettier --write --loglevel warn --cache .; true",
         "lint-list": "echo 'Style checking...'; prettier --check .; echo 'Linting...'; eslint src; echo 'To view errors in more detail, please run `yarn lint`'; true",
+        "lint-ci" : "echo 'Style checking...' && prettier --check . && echo 'Linting...' && eslint src",
         "setup": "node Installer.js",
         "win-force-build": "clear | rm -r dist | tsc-suppress"
     },
diff --git a/src/commands/settings/automod.ts b/src/commands/settings/automod.ts
index 09b8914..ff9e0b2 100644
--- a/src/commands/settings/automod.ts
+++ b/src/commands/settings/automod.ts
@@ -874,6 +874,7 @@
         await i.deferUpdate();
         if(i.isButton()) {
             await client.database.guilds.write(interaction.guild.id, {filters: config});
+            await client.memory.forceUpdate(interaction.guild.id);
         } else {
             switch(i.values[0]) {
                 case "invites": {
diff --git a/src/commands/settings/autopublish.ts b/src/commands/settings/autopublish.ts
index 2c01fe2..27d01bd 100644
--- a/src/commands/settings/autopublish.ts
+++ b/src/commands/settings/autopublish.ts
@@ -79,6 +79,7 @@
                     await client.database.guilds.write(interaction.guild!.id, { "autoPublish": data });
                     config = await client.database.guilds.read(interaction.guild!.id);
                     data = _.cloneDeep(config.autoPublish);
+                    await client.memory.forceUpdate(interaction.guild!.id);
                     break;
                 }
             }
diff --git a/src/commands/settings/logs/attachment.ts b/src/commands/settings/logs/attachment.ts
index 238b8b9..8f0b257 100644
--- a/src/commands/settings/logs/attachment.ts
+++ b/src/commands/settings/logs/attachment.ts
@@ -93,6 +93,7 @@
                         "logging.attachments.channel": channel
                     });
                     data = await client.database.guilds.read(interaction.guild!.id);
+                    await client.memory.forceUpdate(interaction.guild!.id);
                     break;
                 }
             }
diff --git a/src/commands/settings/logs/events.ts b/src/commands/settings/logs/events.ts
index eeef8fb..05d6928 100644
--- a/src/commands/settings/logs/events.ts
+++ b/src/commands/settings/logs/events.ts
@@ -139,6 +139,7 @@
                     await client.database.guilds.write(interaction.guild!.id, {"logging.logs": data});
                     config = await client.database.guilds.read(interaction.guild!.id);
                     data = Object.assign({}, config.logging.logs);
+                    await client.memory.forceUpdate(interaction.guild!.id)
                     break;
                 }
                 case "remove": {
diff --git a/src/commands/settings/logs/warnings.ts b/src/commands/settings/logs/warnings.ts
index 84772e6..4d9a3fa 100644
--- a/src/commands/settings/logs/warnings.ts
+++ b/src/commands/settings/logs/warnings.ts
@@ -81,6 +81,7 @@
                         "logging.warnings.channel": channel
                     });
                     data = await client.database.guilds.read(interaction.guild!.id);
+                    await client.memory.forceUpdate(interaction.guild!.id);
                     break;
                 }
             }
diff --git a/src/commands/settings/rolemenu.ts b/src/commands/settings/rolemenu.ts
index cccb6f6..ae174b3 100644
--- a/src/commands/settings/rolemenu.ts
+++ b/src/commands/settings/rolemenu.ts
@@ -436,8 +436,9 @@
                     break;
                 }
                 case "save": {
-                    client.database.guilds.write(interaction.guild.id, {"roleMenu.options": currentObject});
+                    await client.database.guilds.write(interaction.guild.id, {"roleMenu.options": currentObject});
                     modified = false;
+                    await client.memory.forceUpdate(interaction.guild.id);
                     break;
                 }
             }
diff --git a/src/commands/settings/stats.ts b/src/commands/settings/stats.ts
index d46b57e..ecab612 100644
--- a/src/commands/settings/stats.ts
+++ b/src/commands/settings/stats.ts
@@ -378,9 +378,10 @@
                     break;
                 }
                 case "save": {
-                    client.database.guilds.write(interaction.guild.id, {stats: currentObject});
+                    await client.database.guilds.write(interaction.guild.id, {stats: currentObject});
                     singleNotify("statsChannelDeleted", interaction.guild.id, true);
                     modified = false;
+                    await client.memory.forceUpdate(interaction.guild.id);
                     break;
                 }
             }
@@ -400,4 +401,4 @@
 
 export { command };
 export { callback };
-export { check };
\ No newline at end of file
+export { check };
diff --git a/src/commands/settings/tickets.ts b/src/commands/settings/tickets.ts
index 2e046bf..838defb 100644
--- a/src/commands/settings/tickets.ts
+++ b/src/commands/settings/tickets.ts
@@ -135,6 +135,7 @@
                     await i.deferUpdate();
                     await client.database.guilds.write(interaction.guild.id, { tickets: ticketData });
                     changesMade = false;
+                    await client.memory.forceUpdate(interaction.guild.id);
                     break;
                 }
                 case "enabled": {
diff --git a/src/commands/settings/tracks.ts b/src/commands/settings/tracks.ts
index d9d485d..39efede 100644
--- a/src/commands/settings/tracks.ts
+++ b/src/commands/settings/tracks.ts
@@ -413,6 +413,7 @@
                 case "save": {
                     client.database.guilds.write(interaction.guild!.id, {tracks: tracks});
                     modified = false;
+                    await client.memory.forceUpdate(interaction.guild!.id);
                     break;
                 }
             }
diff --git a/src/commands/settings/verify.ts b/src/commands/settings/verify.ts
index c440b75..9c091a1 100644
--- a/src/commands/settings/verify.ts
+++ b/src/commands/settings/verify.ts
@@ -88,6 +88,7 @@
                     client.database.guilds.write(interaction.guild.id, {"verify": data} )
                     config = await client.database.guilds.read(interaction.guild.id);
                     data = Object.assign({}, config.verify);
+                    await client.memory.forceUpdate(interaction.guild.id);
                     break
                 }
                 case "switch": {
diff --git a/src/commands/settings/welcome.ts b/src/commands/settings/welcome.ts
index 7584624..b2d484c 100644
--- a/src/commands/settings/welcome.ts
+++ b/src/commands/settings/welcome.ts
@@ -223,6 +223,7 @@
                     await client.database.guilds.write(interaction.guild!.id, {"welcome": data});
                     config = await client.database.guilds.read(interaction.guild!.id);
                     data = Object.assign({}, config.welcome);
+                    await client.memory.forceUpdate(interaction.guild!.id)
                     break;
                 }
                 case "channelDM": {
@@ -297,4 +298,4 @@
     return autocompletions;
 };
 
-export { command, callback, check, autocomplete };
\ No newline at end of file
+export { command, callback, check, autocomplete };
diff --git a/src/events/messageCreate.ts b/src/events/messageCreate.ts
index 4f525fc..14ec7e5 100644
--- a/src/events/messageCreate.ts
+++ b/src/events/messageCreate.ts
@@ -5,12 +5,22 @@
 import getEmojiByName from "../utils/getEmojiByName.js";
 import client from "../utils/client.js";
 import { callback as statsChannelUpdate } from "../reflex/statsChannelUpdate.js";
-import { Message, ThreadChannel } from "discord.js";
+import { ChannelType, Message, ThreadChannel } from "discord.js";
 
 export const event = "messageCreate";
 
 export async function callback(_client: NucleusClient, message: Message) {
     if (!message.guild) return;
+    const config = await client.memory.readGuildInfo(message.guild.id);
+
+    if (config.autoPublish.enabled 
+        && config.autoPublish.channels.includes(message.channel.id)
+        && message.channel.type === ChannelType.GuildAnnouncement
+        && message.reference === null
+    ) {
+        await message.crosspost();
+    }
+
     if (message.author.bot) return;
     if (message.channel.isDMBased()) return;
     try {
@@ -24,7 +34,6 @@
     const fileNames = await logAttachment(message);
 
     const content = message.content.toLowerCase() || "";
-    const config = await client.memory.readGuildInfo(message.guild.id);
     if(config.filters.clean.channels.includes(message.channel.id)) {
         const memberRoles = message.member!.roles.cache.map(role => role.id);
         const roleAllow = config.filters.clean.allowed.roles.some(role => memberRoles.includes(role));
@@ -32,10 +41,6 @@
         if(!roleAllow && !userAllow) return await message.delete();
     }
 
-    if (config.autoPublish.enabled && config.autoPublish.channels.includes(message.channel.id)) {
-        await message.crosspost();
-    }
-
     const filter = getEmojiByName("ICONS.FILTER");
     let attachmentJump = "";
     if (config.logging.attachments.saved[message.channel.id + message.id]) {
diff --git a/src/index.ts b/src/index.ts
index 12f6659..ddcd97b 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -1,3 +1,5 @@
+import "@total-typescript/ts-reset";
+
 import runServer from "./api/index.js";
 import client from "./utils/client.js";
 import config from "./config/main.js";
diff --git a/src/utils/database.ts b/src/utils/database.ts
index c1728c3..a60cf74 100644
--- a/src/utils/database.ts
+++ b/src/utils/database.ts
@@ -263,7 +263,7 @@
                 }
             }
             if(!data) return null;
-            doc = JSON.parse(Buffer.from(data).toString());
+            doc = JSON.parse(Buffer.from(data).toString()) as TranscriptSchema;
         }
         if(!doc) return null;
         return doc;
@@ -294,7 +294,7 @@
                 }
             }
             if(!data) return null;
-            doc = JSON.parse(Buffer.from(data).toString());
+            doc = JSON.parse(Buffer.from(data).toString()) as TranscriptSchema;
         }
         if(!doc) return null;
         for(const message of doc.messages) {