mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-06 14:20:51 +02:00
Fix
This commit is contained in:
@@ -83,6 +83,6 @@ module.exports = class AceAttorneyCommand extends Command {
|
||||
let text = wrapText(ctx, quote, 242);
|
||||
text = text.length > 5 ? `${text.slice(0, 5).join('\n')}...` : text.join('\n');
|
||||
fillTextWithBreaks(ctx, text, 7, 199);
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: `ace-attorney-${character}.png` }] });
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer('image/png'), name: `ace-attorney-${character}.png` }] });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -56,6 +56,6 @@ module.exports = class AchievementCommand extends Command {
|
||||
ctx.fillText('Achievement Get!', 60, 40);
|
||||
ctx.fillStyle = '#ffffff';
|
||||
ctx.fillText(shortenText(ctx, text, 230), 60, 60);
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'achievement.png' }] });
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer('image/png'), name: 'achievement.png' }] });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -60,6 +60,6 @@ module.exports = class CautionCommand extends Command {
|
||||
const height = topMost + ((fontSize + 20) * i);
|
||||
ctx.fillText(lines[i], base.width / 2, height);
|
||||
}
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'caution.png' }] });
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer('image/png'), name: 'caution.png' }] });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -63,6 +63,6 @@ module.exports = class CertificateCommand extends Command {
|
||||
ctx.fillText(reason, 518, 273);
|
||||
ctx.fillText(name, 518, 419);
|
||||
ctx.fillText(moment().format('MM/DD/YYYY'), 309, 503);
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'certificate.png' }] });
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer('image/png'), name: 'certificate.png' }] });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -65,6 +65,6 @@ module.exports = class ChineseRestaurantCommand extends Command {
|
||||
ctx.fillText(lines[2], base.width / 2, 315);
|
||||
ctx.fillText(lines[3], base.width / 2, 342);
|
||||
}
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'chinese-restaurant.png' }] });
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer('image/png'), name: 'chinese-restaurant.png' }] });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -60,6 +60,6 @@ module.exports = class DangerCommand extends Command {
|
||||
const height = topMost + ((fontSize + 20) * i);
|
||||
ctx.fillText(lines[i], base.width / 2, height);
|
||||
}
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'danger.png' }] });
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer('image/png'), name: 'danger.png' }] });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -47,6 +47,6 @@ module.exports = class FontCommand extends Command {
|
||||
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
||||
ctx.fillStyle = 'black';
|
||||
fillTextWithBreaks(ctx, lines.join('\n'), 25, 25);
|
||||
return canvas.toBuffer();
|
||||
return canvas.toBuffer('image/png');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -55,6 +55,6 @@ module.exports = class GandhiQuoteCommand extends Command {
|
||||
const height = topMost + ((fontSize + 20) * i);
|
||||
ctx.fillText(lines[i], 395, height);
|
||||
}
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'gandhi-quote.png' }] });
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer('image/png'), name: 'gandhi-quote.png' }] });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -65,6 +65,6 @@ module.exports = class HighwaySignCommand extends Command {
|
||||
ctx.fillText(lines[2], 318, 128);
|
||||
ctx.fillText(lines[3], 318, 147);
|
||||
}
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'highway-sign.png' }] });
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer('image/png'), name: 'highway-sign.png' }] });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -55,6 +55,6 @@ module.exports = class HollywoodStarCommand extends Command {
|
||||
ctx.textAlign = 'center';
|
||||
ctx.textBaseline = 'top';
|
||||
ctx.fillText(name.toLowerCase(), 288, 140);
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'hollywood-star.png' }] });
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer('image/png'), name: 'hollywood-star.png' }] });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -57,6 +57,6 @@ module.exports = class JeopardyQuestionCommand extends Command {
|
||||
ctx.fillStyle = 'white';
|
||||
ctx.fillText(lines[i], canvas.width / 2, height);
|
||||
}
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'jeopardy-question.png' }] });
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer('image/png'), name: 'jeopardy-question.png' }] });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -48,6 +48,6 @@ module.exports = class LicensePlateCommand extends Command {
|
||||
ctx.textBaseline = 'middle';
|
||||
ctx.font = this.client.fonts.get('LicensePlate.ttf').toCanvasString(180);
|
||||
ctx.fillText(text.toUpperCase(), base.width / 2, base.height / 2, 700);
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'license-plate.png' }] });
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer('image/png'), name: 'license-plate.png' }] });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -50,6 +50,6 @@ module.exports = class SpeedLimitCommand extends Command {
|
||||
ctx.font = this.client.fonts.get('HWYGWDE.ttf').toCanvasString(360);
|
||||
ctx.fillStyle = 'black';
|
||||
ctx.fillText(limit.toUpperCase(), 313, 356, 475);
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'speed-limit.png' }] });
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer('image/png'), name: 'speed-limit.png' }] });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -85,6 +85,6 @@ module.exports = class SpongebobTimeCardCommand extends Command {
|
||||
ctx.fillStyle = 'black';
|
||||
ctx.fillText(lines[i], canvas.width / 2, height);
|
||||
}
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'spongebob-time-card.png' }] });
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer('image/png'), name: 'spongebob-time-card.png' }] });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -202,7 +202,7 @@ module.exports = class TweetCommand extends Command {
|
||||
ctx.clip();
|
||||
}
|
||||
ctx.drawImage(avatar, 17, 84, 52, 52);
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'tweet.png' }] });
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer('image/png'), name: 'tweet.png' }] });
|
||||
}
|
||||
|
||||
roundedPath(ctx, radius, x, y, imageWidth, imageHeight) {
|
||||
|
||||
@@ -117,6 +117,6 @@ module.exports = class UndertaleCommand extends Command {
|
||||
for (let i = 0; i < lines; i++) {
|
||||
ctx.fillText(text[i], 174, 22 + (22 * i) + (22 * i) + (space * i));
|
||||
}
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: `undertale-${character}.png` }] });
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer('image/png'), name: `undertale-${character}.png` }] });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -64,6 +64,6 @@ module.exports = class ZeroDialogueCommand extends Command {
|
||||
let text = wrapText(ctx, quote, 425);
|
||||
text = text.length > 2 ? `${text.slice(0, 2).join('\n')}...` : text.join('\n');
|
||||
fillTextWithBreaks(ctx, text, 8, 8);
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'zero-dialogue.png' }] });
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer('image/png'), name: 'zero-dialogue.png' }] });
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user