|
|
|
@ -11,6 +11,12 @@ export const event = "messageCreate";
|
|
|
|
|
|
|
|
|
|
|
|
export async function callback(_client: NucleusClient, message: Message) {
|
|
|
|
export async function callback(_client: NucleusClient, message: Message) {
|
|
|
|
if (!message.guild) return;
|
|
|
|
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.author.bot) return;
|
|
|
|
if (message.channel.isDMBased()) return;
|
|
|
|
if (message.channel.isDMBased()) return;
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
@ -24,7 +30,6 @@ export async function callback(_client: NucleusClient, message: Message) {
|
|
|
|
const fileNames = await logAttachment(message);
|
|
|
|
const fileNames = await logAttachment(message);
|
|
|
|
|
|
|
|
|
|
|
|
const content = message.content.toLowerCase() || "";
|
|
|
|
const content = message.content.toLowerCase() || "";
|
|
|
|
const config = await client.memory.readGuildInfo(message.guild.id);
|
|
|
|
|
|
|
|
if(config.filters.clean.channels.includes(message.channel.id)) {
|
|
|
|
if(config.filters.clean.channels.includes(message.channel.id)) {
|
|
|
|
const memberRoles = message.member!.roles.cache.map(role => role.id);
|
|
|
|
const memberRoles = message.member!.roles.cache.map(role => role.id);
|
|
|
|
const roleAllow = config.filters.clean.allowed.roles.some(role => memberRoles.includes(role));
|
|
|
|
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(!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");
|
|
|
|
const filter = getEmojiByName("ICONS.FILTER");
|
|
|
|
let attachmentJump = "";
|
|
|
|
let attachmentJump = "";
|
|
|
|
if (config.logging.attachments.saved[message.channel.id + message.id]) {
|
|
|
|
if (config.logging.attachments.saved[message.channel.id + message.id]) {
|
|
|
|
|