mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Analyzers should reply
This commit is contained in:
@@ -31,8 +31,8 @@ module.exports = class FaceAnalyzeCommand extends Command {
|
||||
app_key: KAIROS_KEY
|
||||
})
|
||||
.send({ image: face });
|
||||
if (!body.images) return msg.say('There are no faces in this image.');
|
||||
if (body.images[0].faces.length > 1) return msg.say('Please provide only one face in the image.');
|
||||
if (!body.images) return msg.reply('There are no faces in this image.');
|
||||
if (body.images[0].faces.length > 1) return msg.reply('Please provide only one face in the image.');
|
||||
const data = body.images[0].faces[0].attributes;
|
||||
const race = races.sort((a, b) => data[b] - data[a])[0];
|
||||
const gender = data.gender.maleConfidence > data.gender.femaleConfidence ? 'man' : 'woman';
|
||||
|
||||
@@ -31,9 +31,9 @@ module.exports = class SevereToxicityCommand extends Command {
|
||||
requestedAttributes: { SEVERE_TOXICITY: {} }
|
||||
});
|
||||
const toxicity = Math.round(body.attributeScores.SEVERE_TOXICITY.summaryScore.value * 100);
|
||||
if (toxicity >= 70) return msg.say(`Likely to be perceived as toxic. (${toxicity}%)`);
|
||||
if (toxicity >= 40) return msg.say(`Unsure if this will be perceived as toxic. (${toxicity}%)`);
|
||||
return msg.say(`Unlikely to be perceived as toxic. (${toxicity}%)`);
|
||||
if (toxicity >= 70) return msg.reply(`Likely to be perceived as toxic. (${toxicity}%)`);
|
||||
if (toxicity >= 40) return msg.reply(`Unsure if this will be perceived as toxic. (${toxicity}%)`);
|
||||
return msg.reply(`Unlikely to be perceived as toxic. (${toxicity}%)`);
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
|
||||
@@ -31,9 +31,9 @@ module.exports = class ToxicityCommand extends Command {
|
||||
requestedAttributes: { TOXICITY: {} }
|
||||
});
|
||||
const toxicity = Math.round(body.attributeScores.TOXICITY.summaryScore.value * 100);
|
||||
if (toxicity >= 70) return msg.say(`Likely to be perceived as toxic. (${toxicity}%)`);
|
||||
if (toxicity >= 40) return msg.say(`Unsure if this will be perceived as toxic. (${toxicity}%)`);
|
||||
return msg.say(`Unlikely to be perceived as toxic. (${toxicity}%)`);
|
||||
if (toxicity >= 70) return msg.reply(`Likely to be perceived as toxic. (${toxicity}%)`);
|
||||
if (toxicity >= 40) return msg.reply(`Unsure if this will be perceived as toxic. (${toxicity}%)`);
|
||||
return msg.reply(`Unlikely to be perceived as toxic. (${toxicity}%)`);
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "67.1.0",
|
||||
"version": "67.1.1",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user