mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Face Gender Command
This commit is contained in:
@@ -108,7 +108,7 @@ things, I'm not taking any chances.
|
||||
19. Start Xiao up!
|
||||
|
||||
## Commands
|
||||
Total: 516
|
||||
Total: 517
|
||||
|
||||
### Utility:
|
||||
|
||||
@@ -317,12 +317,13 @@ Total: 516
|
||||
* **character-count:** Responds with the character count of text.
|
||||
* **chinese-zodiac:** Responds with the Chinese Zodiac Sign for the given year.
|
||||
* **dominant-color:** Determines the dominant color of an image.
|
||||
* **face-gender:** Determines the gender of a face.
|
||||
* **faces:** Shows all detected faces in an image.
|
||||
* **gender:** Determines the gender of a name.
|
||||
* **generation:** Responds with the Generation for the given year.
|
||||
* **image-size:** Determines the size of an image.
|
||||
* **is-it-down:** Determines if a website is down or not.
|
||||
* **levenshtein:** Determines the levenshtein distance between two strings.
|
||||
* **name-gender:** Determines the gender of a name.
|
||||
* **nsfw-image:** Determines if an image is NSFW.
|
||||
* **nsfw-url:** Determines if a URL is NSFW.
|
||||
* **parse-time:** Analyzes the time duration you provide and gives the result.
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
const Command = require('../../framework/Command');
|
||||
const request = require('node-superfetch');
|
||||
|
||||
module.exports = class FaceGenderCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'face-gender',
|
||||
aliases: ['guess-face-gender', 'face-gender-guess', 'gender-face', 'gender'],
|
||||
group: 'analyze',
|
||||
description: 'Determines the gender of a face.',
|
||||
credit: [
|
||||
{
|
||||
name: 'Nyckel',
|
||||
url: 'https://www.nyckel.com/pretrained-classifiers/gender-detector/',
|
||||
reason: 'API'
|
||||
}
|
||||
],
|
||||
args: [
|
||||
{
|
||||
key: 'image',
|
||||
type: 'image'
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, { image }) {
|
||||
const { body } = await request
|
||||
.post(`https://www.nyckel.com/v1/functions/gender-detector/invoke`)
|
||||
.send({ data: image });
|
||||
return msg.say(`I'm ${Math.round(body.confidence * 100)}% sure this is a ${body.labelName}.`);
|
||||
}
|
||||
};
|
||||
@@ -1,11 +1,11 @@
|
||||
const Command = require('../../framework/Command');
|
||||
const request = require('node-superfetch');
|
||||
|
||||
module.exports = class GenderCommand extends Command {
|
||||
module.exports = class NameGenderCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'gender',
|
||||
aliases: ['guess-gender', 'gender-guess'],
|
||||
name: 'name-gender',
|
||||
aliases: ['guess-name-gender', 'name-gender-guess', 'gender-name'],
|
||||
group: 'analyze',
|
||||
description: 'Determines the gender of a name.',
|
||||
credit: [
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "153.0.1",
|
||||
"version": "153.1.0",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user