Add some more checks for what autoPublish can publish
diff --git a/src/events/messageCreate.ts b/src/events/messageCreate.ts
index 4f525fc..e98477b 100644
--- a/src/events/messageCreate.ts
+++ b/src/events/messageCreate.ts
@@ -5,7 +5,7 @@
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";
@@ -32,7 +32,11 @@
if(!roleAllow && !userAllow) return await message.delete();
}
- if (config.autoPublish.enabled && config.autoPublish.channels.includes(message.channel.id)) {
+ if (config.autoPublish.enabled
+ && config.autoPublish.channels.includes(message.channel.id)
+ && message.channel.type === ChannelType.GuildAnnouncement
+ && message.reference === null
+ ) {
await message.crosspost();
}