mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Bart Chalkboard mobile bart
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 62 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 151 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
@@ -41,7 +41,10 @@ module.exports = class LisaPresentationCommand extends Command {
|
||||
}
|
||||
|
||||
async run(msg, { text }) {
|
||||
const base = await loadImage(path.join(__dirname, '..', '..', 'assets', 'images', 'bart-chalkboard.png'));
|
||||
const base = await loadImage(
|
||||
path.join(__dirname, '..', '..', 'assets', 'images', 'bart-chalkboard', 'chalkboard.png')
|
||||
);
|
||||
const bart = await loadImage(path.join(__dirname, '..', '..', 'assets', 'images', 'bart-chalkboard', 'bart.png'));
|
||||
const canvas = createCanvas(base.width, base.height);
|
||||
const ctx = canvas.getContext('2d');
|
||||
ctx.drawImage(base, 0, 0);
|
||||
@@ -49,9 +52,11 @@ module.exports = class LisaPresentationCommand extends Command {
|
||||
ctx.font = this.client.fonts.get('akbar.ttf').toCanvasString(19);
|
||||
ctx.fillStyle = 'white';
|
||||
const shortened = shortenText(ctx, text.toUpperCase(), 500);
|
||||
const len = ctx.measureText(shortened);
|
||||
const arr = [];
|
||||
for (let i = 0; i < 12; i++) arr.push(shortened);
|
||||
fillTextWithBreaks(ctx, arr.join('\n'), 30, 27);
|
||||
ctx.drawImage(bart, Math.min(522, 30 + len), 142, 103, 212);
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer('image/png'), name: 'bart-chalkboard.png' }] });
|
||||
}
|
||||
};
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "155.2.2",
|
||||
"version": "155.2.3",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user