diff --git a/src/commands/settings/autopublish.ts b/src/commands/settings/autopublish.ts
new file mode 100644
index 0000000..c4b9b56
--- /dev/null
+++ b/src/commands/settings/autopublish.ts
@@ -0,0 +1,96 @@
+import { ActionRowBuilder, ButtonBuilder, ButtonStyle, ChannelSelectMenuBuilder, CommandInteraction, SlashCommandSubcommandBuilder } from "discord.js";
+import type Discord from "discord.js";
+import client from "../../utils/client.js";
+import { LoadingEmbed } from "../../utils/defaults.js";
+import compare from "lodash"
+import EmojiEmbed from "../../utils/generateEmojiEmbed.js";
+
+export const command = new SlashCommandSubcommandBuilder()
+    .setName("autopublish")
+    .setDescription("Automatically publish messages posted in announcement channels");
+
+export const callback = async (interaction: CommandInteraction): Promise<void> => {
+    await interaction.reply({
+        embeds: LoadingEmbed,
+        ephemeral: true,
+        fetchReply: true
+    });
+
+    let closed = false;
+    let config = await client.database.guilds.read(interaction.guild!.id);
+    let data = Object.assign({}, config.autoPublish);
+    do {
+        const buttons = new ActionRowBuilder<ButtonBuilder>()
+            .addComponents(
+                new ButtonBuilder()
+                    .setCustomId("switch")
+                    .setLabel(data.enabled ? "Disabled" : "Enabled")
+                    .setStyle(data.enabled ? ButtonStyle.Danger : ButtonStyle.Success)
+                    .setEmoji(data.enabled ? "✅" : "❌"),
+                new ButtonBuilder()
+                    .setCustomId("save")
+                    .setLabel("Save")
+                    .setStyle(ButtonStyle.Success)
+                    .setEmoji("💾")
+                    .setDisabled(compare.isEqual(data, config.autoPublish))
+            );
+
+        const channelSelect = new ActionRowBuilder<ChannelSelectMenuBuilder>()
+            .addComponents(
+                new ChannelSelectMenuBuilder()
+                    .setCustomId("channel")
+                    .setPlaceholder("Select a channel")
+                    .setMinValues(1)
+            );
+
+        const embed = new EmojiEmbed()
+
+        await interaction.editReply({
+            embeds: [embed],
+            components: [channelSelect, buttons]
+        });
+
+        let i: Discord.ButtonInteraction | Discord.ChannelSelectMenuInteraction;
+        try {
+            i = await interaction.channel!.awaitMessageComponent({
+                filter: (i) => i.user.id === interaction.user.id,
+                time: 300000
+            }) as Discord.ButtonInteraction | Discord.ChannelSelectMenuInteraction;
+        } catch (e) {
+            closed = true;
+            break;
+        }
+
+        if(i.isButton()) {
+            switch(i.customId) {
+                case "switch": {
+                    data.enabled = !data.enabled;
+                    break;
+                }
+                case "save": {
+                    await client.database.guilds.write(interaction.guild!.id, { "autoPublish": data });
+                    config = await client.database.guilds.read(interaction.guild!.id);
+                    data = Object.assign({}, config.autoPublish);
+                    break;
+                }
+            }
+        } else {
+            for(const channel of i.values) {
+                data.channels.includes(channel) ? data.channels.splice(data.channels.indexOf(channel), 1) : data.channels.push(channel);
+            }
+        }
+
+    } while (!closed);
+
+    await interaction.deleteReply();
+}
+
+export const check = (interaction: CommandInteraction, _partial: boolean = false) => {
+    const member = interaction.member as Discord.GuildMember;
+    const me = interaction.guild!.members.me as Discord.GuildMember;
+    if (!member.permissions.has("ManageMessages"))
+        return "You must have the *Manage Messages* permission to use this command";
+    if (_partial) return true;
+    if (!me.permissions.has("ManageMessages")) return "I do not have the *Manage Messages* permission";
+    return true;
+};
diff --git a/src/config/default.json b/src/config/default.json
index e972e93..858a835 100644
--- a/src/config/default.json
+++ b/src/config/default.json
@@ -114,5 +114,9 @@
     },
     "tracks": [],
     "roleMenu": [],
-    "tags": {}
+    "tags": {},
+    "autoPublish": {
+        "enabled": false,
+        "channels": []
+    }
 }
diff --git a/src/events/messageCreate.ts b/src/events/messageCreate.ts
index 804e6ea..0a62019 100644
--- a/src/events/messageCreate.ts
+++ b/src/events/messageCreate.ts
@@ -31,6 +31,11 @@
         let userAllow = config.filters.clean.allowed.user.includes(message.author.id);
         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/utils/database.ts b/src/utils/database.ts
index 6eb735e..aa7fd36 100644
--- a/src/utils/database.ts
+++ b/src/utils/database.ts
@@ -340,6 +340,10 @@
             }
         }
     };
+    autoPublish: {
+        enabled: boolean;
+        channels: string[];
+    }
     welcome: {
         enabled: boolean;
         role: string | null;
diff --git a/src/utils/memory.ts b/src/utils/memory.ts
index 870ffaf..60a6535 100644
--- a/src/utils/memory.ts
+++ b/src/utils/memory.ts
@@ -7,6 +7,7 @@
     logging: GuildConfig["logging"];
     tickets: GuildConfig["tickets"];
     tags: GuildConfig["tags"];
+    autoPublish: GuildConfig["autoPublish"];
 }
 
 class Memory {
@@ -31,7 +32,8 @@
                 filters: guildData.filters,
                 logging: guildData.logging,
                 tickets: guildData.tickets,
-                tags: guildData.tags
+                tags: guildData.tags,
+                autoPublish: guildData.autoPublish
             });
         }
         return this.memory.get(guild)!;
