diff --git a/src/events/messageCreate.ts b/src/events/messageCreate.ts
index e98477b..14ec7e5 100644
--- a/src/events/messageCreate.ts
+++ b/src/events/messageCreate.ts
@@ -11,6 +11,16 @@
 
 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,14 +41,6 @@
         if(!roleAllow && !userAllow) return await message.delete();
     }
 
-    if (config.autoPublish.enabled 
-        && config.autoPublish.channels.includes(message.channel.id)
-        && message.channel.type === ChannelType.GuildAnnouncement
-        && message.reference === null
-    ) {
-        await message.crosspost();
-    }
-
     const filter = getEmojiByName("ICONS.FILTER");
     let attachmentJump = "";
     if (config.logging.attachments.saved[message.channel.id + message.id]) {
