i have not committed in years
diff --git a/src/automations/statsChannelRemove.ts b/src/automations/statsChannelRemove.ts
index 42ec580..4b24768 100644
--- a/src/automations/statsChannelRemove.ts
+++ b/src/automations/statsChannelRemove.ts
@@ -1,8 +1,9 @@
import log from '../utils/log.js'
import readConfig from '../utils/readConfig.js'
import convertCurlyBracketString from '../utils/convertCurlyBracketString.js'
+import singleNotify from '../utils/singleNotify.js';
-export async function callback(_, member) {
+export async function callback(interaction, member) {
let config = await readConfig(member.guild.id);
config.stats.forEach(async element => {
@@ -13,7 +14,12 @@
let channel = await member.client.channels.fetch(element.channel)
if (channel.guild.id !== member.guild.id) return
- if (!channel) return // TODO: Notify mods
+ if (!channel) return await singleNotify(interaction.client,
+ "statsChannelDeleted",
+ member.guild.id,
+ "The stats channel has been deleted. Please set a new channel to use this feature.",
+ "Critical"
+ )
try {
await channel.edit({ name: string })
} catch (err) {
diff --git a/src/automations/unscan.ts b/src/automations/unscan.ts
index 1fb47f8..743374b 100644
--- a/src/automations/unscan.ts
+++ b/src/automations/unscan.ts
@@ -1,10 +1,12 @@
import * as scan from '../utils/scanners.js'
+import Tesseract from 'tesseract.js';
export async function LinkCheck(message): Promise<boolean> {
let links = message.content.match(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/gi) ?? []
let detections = []
const promises = links.map(async element => {
try {
+ if (element.match(/https?:\/\/[a-zA-Z]+\.?discord(app)?\.(com|net)\/?/)) return // Also matches discord.net, not enough of a bug
element = await scan.testLink(element)
} catch {}
detections.push({tags: element.tags || [], safe: element.safe})
@@ -27,9 +29,9 @@
export async function NSFWCheck(element): Promise<boolean> {
try {
+ let test = (await scan.testNSFW(element))
//@ts-ignore
- let test = (await scan.testNSFW(element)).nsfw
- return test
+ return test.nsfw
} catch {
return false
}
@@ -64,4 +66,8 @@
}
}
return "none"
+}
+
+export async function TestImage(element): Promise<string> {
+ return "";
}
\ No newline at end of file
diff --git a/src/automations/welcome.ts b/src/automations/welcome.ts
index 6505265..09e03d3 100644
--- a/src/automations/welcome.ts
+++ b/src/automations/welcome.ts
@@ -17,7 +17,6 @@
}
}
-
if (!config.welcome.verificationRequired.message && config.welcome.channel) {
let string = config.welcome.message
if (string) {
@@ -32,7 +31,7 @@
} else {
let channel = await member.client.channels.fetch(config.welcome.channel)
if (channel.guild.id !== member.guild.id) return
- if (!channel) return // TODO: Notify mods
+ if (!channel) return
try {
await channel.send(string)
} catch (err) {