Bart Chalkboard Command

This commit is contained in:
Dragon Fire
2020-03-28 13:28:57 -04:00
parent 4e6777af8d
commit ee683fe45e
5 changed files with 60 additions and 2 deletions
+4 -1
View File
@@ -120,7 +120,7 @@ don't grant that permission.
## Commands
Total: 381
Total: 382
### Utility:
@@ -391,6 +391,7 @@ Total: 381
* **apple-engraving:** Engraves the text of your choice onto an Apple product.
* **approved:** Draws an "approved" stamp over an image or a user's avatar.
* **axis-cult-sign-up:** Sends an Axis Cult Sign-Up sheet for you. Join today!
* **bart-chalkboard:** Sends a "Bart Chalkboard" meme with the text of your choice.
* **brazzers:** Draws an image with the Brazzers logo in the corner. (NSFW)
* **circle:** Draws an image or a user's avatar as a circle.
* **color:** Sends an image of the color you choose.
@@ -798,6 +799,8 @@ here.
* jisho (API)
- [JoJo's Bizzare Adventure](http://www.araki-jojo.com/)
* to-be-continued (Original Anime)
- [Jon Bernhardt](http://web.mit.edu/jonb/www/)
* bart-chalkboard ([Akbar Font](https://www.wobblymusic.com/groening/akbar.html))
- [Kickstarter](https://www.kickstarter.com/)
* kickstarter (API)
- [KINMOZA!](http://www.kinmosa.com/)
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

+55
View File
@@ -0,0 +1,55 @@
const Command = require('../../structures/Command');
const { createCanvas, loadImage, registerFont } = require('canvas');
const path = require('path');
const { shortenText } = require('../../util/Canvas');
registerFont(path.join(__dirname, '..', '..', 'assets', 'fonts', 'akbar.ttf'), { family: 'Akbar' });
module.exports = class LisaPresentationCommand extends Command {
constructor(client) {
super(client, {
name: 'bart-chalkboard',
aliases: ['bart'],
group: 'meme-gen',
memberName: 'bart-chalkboard',
description: 'Sends a "Bart Chalkboard" meme with the text of your choice.',
throttling: {
usages: 1,
duration: 10
},
clientPermissions: ['ATTACH_FILES'],
credit: [
{
name: '20th Century Fox',
url: 'https://www.foxmovies.com/',
reason: 'Image, Original "The Simpsons" Show',
reasonURL: 'http://www.simpsonsworld.com/'
},
{
name: 'Jon Bernhardt',
url: 'http://web.mit.edu/jonb/www/',
reason: 'Akbar Font',
reasonURL: 'https://www.wobblymusic.com/groening/akbar.html'
}
],
args: [
{
key: 'text',
prompt: 'What should the text on the chalkboard be?',
type: 'string',
max: 50
}
]
});
}
async run(msg, { text }) {
const base = await loadImage(path.join(__dirname, '..', '..', 'assets', 'images', 'bart-chalkboard.png'));
const canvas = createCanvas(base.width, base.height);
const ctx = canvas.getContext('2d');
ctx.drawImage(base, 0, 0);
ctx.textAlign = 'top';
ctx.font = '19px Akbar';
ctx.fillText(shortenText(ctx, `${text}\n`.repeat(12).trim(), 500), 30, 27);
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'bart-chalkboard.png' }] });
}
};
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "112.18.2",
"version": "112.19.0",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {