mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Speed-up NSFW checks
This commit is contained in:
@@ -33,7 +33,7 @@ module.exports = class ScreenshotCommand extends Command {
|
||||
async run(msg, { site }) {
|
||||
try {
|
||||
const parsed = url.parse(site);
|
||||
if (!msg.channel.nsfw && this.client.adultSiteList.some(pornURL => parsed.host === pornURL)) {
|
||||
if (!msg.channel.nsfw && this.client.adultSiteList.includes(parsed.host)) {
|
||||
return msg.reply('This site is NSFW.');
|
||||
}
|
||||
const { body } = await request.get(`https://image.thum.io/get/width/1920/crop/675/noanimate/${site}`);
|
||||
|
||||
+1
-1
@@ -210,7 +210,7 @@ module.exports = class Util {
|
||||
if (!uris) return str;
|
||||
for (const uri of uris) {
|
||||
const parsed = url.parse(uri);
|
||||
if (!siteList.some(pornURL => parsed.host === pornURL)) continue;
|
||||
if (!siteList.includes(parsed.host)) continue;
|
||||
str = str.replace(uri, text);
|
||||
}
|
||||
return str;
|
||||
|
||||
Reference in New Issue
Block a user