This simple piece of code will check all images sent in your server and then report the img to you if it is adult rated
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
let url = context.params.event.attachments[0].url;
let attach = context.params.event.attachments[0];
let msg = context.params.event.id;
console.log(`Attach: `+attach);
console.log(`URL: `+url);
console.log(`MSG:`+ msg);
let log_channel = `${process.env.LOG_CHANNEL}`;
let check = await lib.captaincool6333['aeolus-api']['@release'].others.imgmod({
url: `${url}`
});
if(check.ratingLabel === `adult`){
let user = context.params.event.author.username + `#`+ context.params.event.author.discriminator;
let id = context.params.event.author.id;
console.log(`isAdult?:` +check.ratingLabel);
await lib.discord.channels['@0.3.0'].messages.create({
"channel_id": `${log_channel}`,
"content": "",
"tts": false,
"embeds": [
{
"type": "rich",
"title": `Adult Content Spotted!`,
"description": `A user who has sent an adult type content has been spotted!`,
"color": 0x51ff00,
"fields": [
{
"name": `Username`,
"value": `${user}`,
"inline": true
},
{
"name": `User Id`,
"value": `\`${id}\``,
"inline": true
}
],
"image": {
"url": `${url}`,
"height": 0,
"width": 0
},
"footer": {
"text": `Created by Captaincool6333#3765`,
"icon_url": `https://cdn.discordapp.com/avatars/596293027627270155/600d3e0e774453eca9b92ccb2f2f4cbf.png`
}
}
]
});
await lib.discord.channels['@0.3.2'].messages.destroy({
message_id: msg,
channel_id: context.params.event.channel_id
});
console.log(`<---------------------------New Logs------------------------------>`);
}