Auto Crosspost

This commit is contained in:
Christopher Cookman 2025-09-28 23:55:29 -06:00
parent f89857a499
commit 911b3aac8e

View file

@ -1,6 +1,7 @@
const fs = require('fs'); const fs = require('fs');
const path = require('path'); const path = require('path');
const https = require('https'); const https = require('https');
const Discord = require('discord.js');
const execute = async (interaction, db, client) => { const execute = async (interaction, db, client) => {
if (!interaction.isCommand()) return; if (!interaction.isCommand()) return;
@ -80,6 +81,10 @@ const execute = async (interaction, db, client) => {
attachment: path.join(__dirname, '../../storage', file), attachment: path.join(__dirname, '../../storage', file),
name: file name: file
})) }))
}).then(msg => {
if (msg.channel.type == Discord.ChannelType.GuildAnnouncement) {
msg.crosspost().catch(console.error); // Try crosspost lol
}
}).catch(console.error); }).catch(console.error);
}) })
}); });