mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-13 15:58:06 +02:00
Name Masc/Fem
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
const Command = require('../../framework/Command');
|
||||
const request = require('node-superfetch');
|
||||
const genders = {
|
||||
male: 'masculine',
|
||||
female: 'feminine'
|
||||
};
|
||||
|
||||
module.exports = class NameGenderCommand extends Command {
|
||||
constructor(client) {
|
||||
@@ -30,6 +34,7 @@ module.exports = class NameGenderCommand extends Command {
|
||||
.get(`https://api.genderize.io/`)
|
||||
.query({ name });
|
||||
if (!body.gender) return msg.say(`I have no idea what gender ${body.name} is.`);
|
||||
return msg.say(`I'm ${Math.round(body.probability * 100)}% sure ${body.name} is a ${body.gender} name.`);
|
||||
const prob = Math.round(body.probability * 100);
|
||||
return msg.say(`I'm ${prob}% sure ${body.name} is a ${genders[body.gender]} name.`);
|
||||
}
|
||||
};
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "153.2.0",
|
||||
"version": "153.2.1",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user