Allow auto publish for bots

pull/38/head
PineappleFan 3 years ago committed by GitHub
parent baffa0aea9
commit 13892c613a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -11,6 +11,12 @@ 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)) {
await message.crosspost();
}
if (message.author.bot) return;
if (message.channel.isDMBased()) return;
try {
@ -24,7 +30,6 @@ export async function callback(_client: NucleusClient, message: Message) {
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 +37,6 @@ export async function callback(_client: NucleusClient, message: Message) {
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]) {

Loading…
Cancel
Save