mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Fix images being too large... kind of
This commit is contained in:
@@ -19,7 +19,7 @@ module.exports = class AgeCommand extends Command {
|
||||
run(msg, { year }) {
|
||||
const currentYear = new Date().getFullYear();
|
||||
const age = currentYear - year;
|
||||
if (age < 0) return msg.say(`Someone born in ${year} will be born in ${Math.abs(age)} years.`);
|
||||
return msg.say(`Someone born in ${year} would be ${age} years old after their birthday.`);
|
||||
if (age < 0) return msg.say(`Someone born in ${year} will be born in **${Math.abs(age)} years**.`);
|
||||
return msg.say(`Someone born in ${year} would be **${age} years old** after their birthday.`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -20,7 +20,7 @@ module.exports = class BirthstoneCommand extends Command {
|
||||
|
||||
run(msg, { month }) {
|
||||
const stone = stones[month - 1];
|
||||
const alternate = stone.alternate ? ` Alternatively, you can also use ${list(stone.alternate, 'or')}.` : '';
|
||||
return msg.say(`The Birthstone for ${firstUpperCase(months[month - 1])} is ${stone.primary}.${alternate}`);
|
||||
const alternate = stone.alternate ? ` Alternatively, you can also use **${list(stone.alternate, 'or')}**.` : '';
|
||||
return msg.say(`The Birthstone for ${firstUpperCase(months[month - 1])} is **${stone.primary}**.${alternate}`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -19,6 +19,6 @@ module.exports = class ChineseZodiacCommand extends Command {
|
||||
}
|
||||
|
||||
run(msg, { year }) {
|
||||
return msg.say(`The Chinese Zodiac Sign for ${year} is ${signs[year % signs.length]}.`);
|
||||
return msg.say(`The Chinese Zodiac Sign for ${year} is **${signs[year % signs.length]}**.`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -28,6 +28,6 @@ module.exports = class FaceGenderCommand extends Command {
|
||||
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}.`);
|
||||
return msg.say(`I'm ${Math.round(body.confidence * 100)}% sure this is a **${body.labelName}**.`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -39,6 +39,6 @@ module.exports = class FacesCommand extends Command {
|
||||
ctx.fillRect(face.box.xMin, face.box.yMax, face.box.width + lineSize, lineSize);
|
||||
ctx.fillRect(face.box.xMax, face.box.yMin, lineSize, face.box.height);
|
||||
}
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer('image/png'), name: 'faces.png' }] });
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer('image/jpeg'), name: 'faces.jpeg' }] });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -46,6 +46,6 @@ module.exports = class AnimeEyesCommand extends Command {
|
||||
ctx.drawImage(rightEye, leftEyeX, leftEyeY, eyeWidth, eyeHeight);
|
||||
ctx.drawImage(leftEye, rightEyeX, rightEyeY, eyeWidth, eyeHeight);
|
||||
}
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer('image/png'), name: 'anime-eyes.png' }] });
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer('image/jpeg'), name: 'anime-eyes.jpeg' }] });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -51,6 +51,6 @@ module.exports = class DannyDevitoCommand extends Command {
|
||||
height * 1.4
|
||||
);
|
||||
}
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer('image/png'), name: 'danny-devito.png' }] });
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer('image/jpeg'), name: 'danny-devito.jpeg' }] });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -62,6 +62,6 @@ module.exports = class EmojiFaceCommand extends Command {
|
||||
height * 1.4
|
||||
);
|
||||
}
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer('image/png'), name: 'emoji-face.png' }] });
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer('image/jpeg'), name: 'emoji-face.jpeg' }] });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -44,6 +44,6 @@ module.exports = class EyesCommand extends Command {
|
||||
ctx.drawImage(eyes, leftEyeX, leftEyeY, eyeWidth, eyeHeight);
|
||||
ctx.drawImage(eyes, rightEyeX, rightEyeY, eyeWidth, eyeHeight);
|
||||
}
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer('image/png'), name: 'eyes.png' }] });
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer('image/jpeg'), name: 'eyes.jpeg' }] });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -51,6 +51,6 @@ module.exports = class ShrekCommand extends Command {
|
||||
height * 1.5
|
||||
);
|
||||
}
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer('image/png'), name: 'shrek.png' }] });
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer('image/jpeg'), name: 'shrek.jpeg' }] });
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user