Fix images being too large... kind of

This commit is contained in:
lilyissillyyy
2025-09-05 23:57:52 -04:00
parent 5f3c74481b
commit deb42234b9
10 changed files with 12 additions and 12 deletions
+2 -2
View File
@@ -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.`);
}
};
+2 -2
View File
@@ -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}`);
}
};
+1 -1
View File
@@ -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]}**.`);
}
};
+1 -1
View File
@@ -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}**.`);
}
};
+1 -1
View File
@@ -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' }] });
}
};
+1 -1
View File
@@ -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' }] });
}
};
+1 -1
View File
@@ -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' }] });
}
};
+1 -1
View File
@@ -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' }] });
}
};
+1 -1
View File
@@ -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' }] });
}
};
+1 -1
View File
@@ -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' }] });
}
};