mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-15 15:57:47 +02:00
NSFW URL Command
This commit is contained in:
@@ -10,13 +10,13 @@ const displayNames = {
|
|||||||
Sexy: 'Suggestive'
|
Sexy: 'Suggestive'
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = class NsfwCommand extends Command {
|
module.exports = class NsfwImageCommand extends Command {
|
||||||
constructor(client) {
|
constructor(client) {
|
||||||
super(client, {
|
super(client, {
|
||||||
name: 'nsfw',
|
name: 'nsfw-image',
|
||||||
aliases: ['nsfw-image', 'nsfw-img', 'img-nsfw', 'image-nsfw'],
|
aliases: ['nsfw', 'nsfw-img', 'img-nsfw', 'image-nsfw'],
|
||||||
group: 'analyze',
|
group: 'analyze',
|
||||||
memberName: 'nsfw',
|
memberName: 'nsfw-image',
|
||||||
description: 'Determines if an image is NSFW.',
|
description: 'Determines if an image is NSFW.',
|
||||||
throttling: {
|
throttling: {
|
||||||
usages: 2,
|
usages: 2,
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
const Command = require('../../structures/Command');
|
||||||
|
const { isUrlNSFW } = require('../../util/Util');
|
||||||
|
|
||||||
|
module.exports = class NsfwUrlCommand extends Command {
|
||||||
|
constructor(client) {
|
||||||
|
super(client, {
|
||||||
|
name: 'nsfw-url',
|
||||||
|
aliases: ['nsfw-uri', 'url-nsfw', 'uri-nsfw'],
|
||||||
|
group: 'analyze',
|
||||||
|
memberName: 'nsfw-url',
|
||||||
|
description: 'Determines if a URL is NSFW.',
|
||||||
|
args: [
|
||||||
|
{
|
||||||
|
key: 'url',
|
||||||
|
prompt: 'What URL would you like to test?',
|
||||||
|
type: 'url'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async run(msg, { url }) {
|
||||||
|
const nsfw = await isUrlNSFW(url, this.client.adultSiteList);
|
||||||
|
if (nsfw === null) return msg.reply('❔ This site sent an error, or just didn\'t respond.');
|
||||||
|
if (!nsfw) return msg.reply('👍 This site is safe!');
|
||||||
|
return msg.reply('👎 This site is NSFW.');
|
||||||
|
}
|
||||||
|
};
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiao",
|
"name": "xiao",
|
||||||
"version": "134.7.0",
|
"version": "134.8.0",
|
||||||
"description": "Your personal server companion.",
|
"description": "Your personal server companion.",
|
||||||
"main": "Xiao.js",
|
"main": "Xiao.js",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
|||||||
Reference in New Issue
Block a user