Increase file size limit to 25MB

This commit is contained in:
Dragon Fire
2024-05-06 00:49:49 -04:00
parent fcb5896b01
commit 9460771b32
60 changed files with 63 additions and 63 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ module.exports = class DeepFryCommand extends Command {
desaturate(ctx, -20, 0, 0, data.width, data.height);
contrast(ctx, 0, 0, data.width, data.height);
const attachment = canvas.toBuffer('image/jpeg', { quality: 0.2 });
if (Buffer.byteLength(attachment) > 8e+6) return msg.reply('Resulting image was above 8 MB.');
if (Buffer.byteLength(attachment) > 2.5e+7) return msg.reply('Resulting image was above 25 MB.');
return msg.say({ files: [{ attachment, name: 'deep-fry.jpeg' }] });
}
};
+1 -1
View File
@@ -46,7 +46,7 @@ module.exports = class DislikeCommand extends Command {
ctx.drawImage(base, 0, 0, plate.width, height);
ctx.drawImage(plate, 0, height);
const attachment = canvas.toBuffer('image/png');
if (Buffer.byteLength(attachment) > 8e+6) return msg.reply('Resulting image was above 8 MB.');
if (Buffer.byteLength(attachment) > 2.5e+7) return msg.reply('Resulting image was above 25 MB.');
return msg.say({ files: [{ attachment, name: 'dislike.png' }] });
}
};
+1 -1
View File
@@ -46,7 +46,7 @@ module.exports = class ForFiveHoursCommand extends Command {
ctx.drawImage(base, 0, 0, plate.width, height);
ctx.drawImage(plate, 0, height + 1);
const attachment = canvas.toBuffer('image/png');
if (Buffer.byteLength(attachment) > 8e+6) return msg.reply('Resulting image was above 8 MB.');
if (Buffer.byteLength(attachment) > 2.5e+7) return msg.reply('Resulting image was above 25 MB.');
return msg.say({ files: [{ attachment, name: 'for-five-hours.png' }] });
}
};
+1 -1
View File
@@ -46,7 +46,7 @@ module.exports = class LikeCommand extends Command {
ctx.drawImage(base, 0, 0, plate.width, height);
ctx.drawImage(plate, 0, height);
const attachment = canvas.toBuffer('image/png');
if (Buffer.byteLength(attachment) > 8e+6) return msg.reply('Resulting image was above 8 MB.');
if (Buffer.byteLength(attachment) > 2.5e+7) return msg.reply('Resulting image was above 25 MB.');
return msg.say({ files: [{ attachment, name: 'like.png' }] });
}
};
+1 -1
View File
@@ -81,7 +81,7 @@ module.exports = class MemeGenCommand extends Command {
ctx.fillText(bottomLines[i], base.width / 2, textHeight);
}
const attachment = canvas.toBuffer('image/png');
if (Buffer.byteLength(attachment) > 8e+6) return msg.reply('Resulting image was above 8 MB.');
if (Buffer.byteLength(attachment) > 2.5e+7) return msg.reply('Resulting image was above 25 MB.');
return msg.say({ files: [{ attachment, name: 'meme-gen.png' }] });
}
};
+1 -1
View File
@@ -75,7 +75,7 @@ module.exports = class NikeAdCommand extends Command {
ctx.fillText(lines[i], data.width / 2, textHeight);
}
const attachment = canvas.toBuffer('image/png');
if (Buffer.byteLength(attachment) > 8e+6) return msg.reply('Resulting image was above 8 MB.');
if (Buffer.byteLength(attachment) > 2.5e+7) return msg.reply('Resulting image was above 25 MB.');
return msg.say({ files: [{ attachment, name: 'nike-ad.png' }] });
}
};
+1 -1
View File
@@ -61,7 +61,7 @@ module.exports = class ReactionMemeCommand extends Command {
fillTextWithBreaks(ctx, lines.join('\n'), 5, 5);
ctx.drawImage(base, 0, linesLen);
const attachment = canvas.toBuffer('image/png');
if (Buffer.byteLength(attachment) > 8e+6) return msg.reply('Resulting image was above 8 MB.');
if (Buffer.byteLength(attachment) > 2.5e+7) return msg.reply('Resulting image was above 25 MB.');
return msg.say({ files: [{ attachment, name: 'meme-gen-modern.png' }] });
}
};
+1 -1
View File
@@ -43,7 +43,7 @@ module.exports = class SexySinglesCommand extends Command {
ctx.drawImage(base, plate.width, 0, width, plate.height);
ctx.drawImage(plate, 0, 0);
const attachment = canvas.toBuffer('image/png');
if (Buffer.byteLength(attachment) > 8e+6) return msg.reply('Resulting image was above 8 MB.');
if (Buffer.byteLength(attachment) > 2.5e+7) return msg.reply('Resulting image was above 25 MB.');
return msg.say({ files: [{ attachment, name: 'sexy-singles.png' }] });
}
};
+1 -1
View File
@@ -65,7 +65,7 @@ module.exports = class SkyrimSkillCommand extends Command {
ctx.fillStyle = 'white';
ctx.fillText(skill, 189, height + 75, 300);
const attachment = canvas.toBuffer('image/png');
if (Buffer.byteLength(attachment) > 8e+6) return msg.reply('Resulting image was above 8 MB.');
if (Buffer.byteLength(attachment) > 2.5e+7) return msg.reply('Resulting image was above 25 MB.');
return msg.say({ files: [{ attachment, name: 'skyrim-skill.png' }] });
}
};
+1 -1
View File
@@ -49,7 +49,7 @@ module.exports = class ThugLifeCommand extends Command {
const height = Math.round(width / ratio);
ctx.drawImage(base, (data.width / 2) - (width / 2), data.height - height, width, height);
const attachment = canvas.toBuffer('image/png');
if (Buffer.byteLength(attachment) > 8e+6) return msg.reply('Resulting image was above 8 MB.');
if (Buffer.byteLength(attachment) > 2.5e+7) return msg.reply('Resulting image was above 25 MB.');
return msg.say({ files: [{ attachment, name: 'thug-life.png' }] });
}
};
+1 -1
View File
@@ -47,7 +47,7 @@ module.exports = class ToBeContinuedCommand extends Command {
const height = Math.round(width / ratio);
ctx.drawImage(base, 0, canvas.height - height, width, height);
const attachment = canvas.toBuffer('image/png');
if (Buffer.byteLength(attachment) > 8e+6) return msg.reply('Resulting image was above 8 MB.');
if (Buffer.byteLength(attachment) > 2.5e+7) return msg.reply('Resulting image was above 25 MB.');
return msg.say({ files: [{ attachment, name: 'to-be-continued.png' }] });
}
};
+1 -1
View File
@@ -46,7 +46,7 @@ module.exports = class VietnamFlashbacksCommand extends Command {
ctx.globalAlpha = 0.675;
ctx.drawImage(data, 0, 0);
const attachment = canvas.toBuffer('image/png');
if (Buffer.byteLength(attachment) > 8e+6) return msg.reply('Resulting image was above 8 MB.');
if (Buffer.byteLength(attachment) > 2.5e+7) return msg.reply('Resulting image was above 25 MB.');
return msg.say({ files: [{ attachment, name: 'vietnam-flashbacks.png' }] });
}
};