diff --git a/README.md b/README.md index d9570482..ae3a9264 100644 --- a/README.md +++ b/README.md @@ -253,7 +253,7 @@ in the appropriate channel's topic to use it. ## Commands -Total: 534 +Total: 535 ### Utility: @@ -731,6 +731,7 @@ Total: 534 * **sos:** Sends a "Esther Verkest's Help Sign" comic with the text of your choice. * **spiderman-pointing:** Sends a "Spiderman Pointing at Spiderman" meme with the text of your choice. * **spongebob-burn:** Sends a "Spongebob Throwing Something into a Fire" meme with words of your choice. +* **that-sign-wont-stop-me:** Sends a "That Sign Won't Stop Me, I Can't read!" meme with the presentation of your choice. * **this-guy:** Draws an image or a user's avatar over the "Get a load of this guy" meme. * **thug-life:** Draws "Thug Life" over an image or a user's avatar. * **to-be-continued:** Draws an image with the "To Be Continued..." arrow. @@ -1331,6 +1332,8 @@ here. * pirate ([English-to-Pirate Dictionary Data](https://github.com/mikewesthad/pirate-speak/blob/master/lib/pirate-speak.js#L1-L155)) - [Minecraft Achievement Generator](https://www.minecraftskinstealer.com/achievement/) * achievement (Image) +- [Missy Meyer](https://missymeyer.com/) + * that-sign-wont-stop-me ([Tragic Marker Font](https://missymeyer.com/tragic-marker-free-font)) - [Mojang](https://www.mojang.com/) * achievement ([Original "Minecraft" Game](https://www.minecraft.net/en-us/)) * minecraft-skin ([API, Original "Minecraft" Game](https://wiki.vg/Mojang_API)) @@ -1424,7 +1427,9 @@ here. * speed-limit (Concept) * spiderman-pointing (Concept) * spotify-now-playing (Concept) + * that-sign-wont-stop-me (Concept) * thicc (Concept) + * tuxedo-pooh (Concept) * undertale (Concept) * wild-pokemon (Concept) * worse-than-hitler (Concept) @@ -1435,6 +1440,8 @@ here. * paladins (API) - [PayPal](https://www.paypal.com/us/home) * donate (Donation Gathering) +- [PBS Kids](https://pbskids.org/) + * that-sign-wont-stop-me ([Image, Original "Arthur" Show](https://pbskids.org/arthur/)) - [Perspective API](https://www.perspectiveapi.com/#/) * severe-toxicity (API) * toxicity (API) diff --git a/assets/fonts/TragicMarker.otf b/assets/fonts/TragicMarker.otf new file mode 100644 index 00000000..76684c9c Binary files /dev/null and b/assets/fonts/TragicMarker.otf differ diff --git a/assets/images/that-sign-wont-stop-me.png b/assets/images/that-sign-wont-stop-me.png new file mode 100644 index 00000000..60a2de84 Binary files /dev/null and b/assets/images/that-sign-wont-stop-me.png differ diff --git a/commands/edit-meme/that-sign-wont-stop-me.js b/commands/edit-meme/that-sign-wont-stop-me.js new file mode 100644 index 00000000..99614381 --- /dev/null +++ b/commands/edit-meme/that-sign-wont-stop-me.js @@ -0,0 +1,83 @@ +const Command = require('../../structures/Command'); +const { createCanvas, loadImage, registerFont } = require('canvas'); +const path = require('path'); +const { wrapText } = require('../../util/Canvas'); +registerFont(path.join(__dirname, '..', '..', 'assets', 'fonts', 'TragicMarker.otf'), { family: 'Tragic Marker' }); + +module.exports = class ThatSignWontStopMeCommand extends Command { + constructor(client) { + super(client, { + name: 'that-sign-wont-stop-me', + aliases: ['sign-wont-stop-me', 'i-cant-read', 'because-i-cant-read', 'dw-sign'], + group: 'edit-meme', + memberName: 'lisa-presentation', + description: 'Sends a "That Sign Won\'t Stop Me, I Can\'t read!" meme with the presentation of your choice.', + throttling: { + usages: 1, + duration: 10 + }, + clientPermissions: ['ATTACH_FILES'], + credit: [ + { + name: 'PBS Kids', + url: 'https://pbskids.org/', + reason: 'Image, Original "Arthur" Show', + reasonURL: 'https://pbskids.org/arthur/' + }, + { + name: 'Missy Meyer', + url: 'https://missymeyer.com/', + reason: 'Tragic Marker Font', + reasonURL: 'https://missymeyer.com/tragic-marker-free-font' + }, + { + name: 'Overtime2005', + url: 'https://github.com/Overtime2005', + reason: 'Concept' + } + ], + args: [ + { + key: 'text', + prompt: 'What should the text of the sign be?', + type: 'string', + max: 500 + } + ] + }); + } + + async run(msg, { text }) { + const base = await loadImage(path.join(__dirname, '..', '..', 'assets', 'images', 'that-sign-wont-stop-me.png')); + const canvas = createCanvas(base.width, base.height); + const ctx = canvas.getContext('2d'); + ctx.drawImage(base, 0, 0); + ctx.textAlign = 'center'; + ctx.textBaseline = 'top'; + ctx.font = '62px Tragic Marker'; + let fontSize = 62; + while (ctx.measureText(text).width > 1002) { + fontSize--; + ctx.font = `${fontSize}px Tragic Marker`; + } + const lines = await wrapText(ctx, text, 334); + const topMost = 220 - (((fontSize * lines.length) / 2) + ((10 * (lines.length - 1)) / 2)); + for (let i = 0; i < lines.length; i++) { + const height = topMost + ((fontSize + 10) * i); + ctx.fillText(lines[i], 210, height); + } + ctx.font = '16px Tragic Marker'; + fontSize = 16; + while (ctx.measureText(text).width > 264) { + fontSize--; + ctx.font = `${fontSize}px Tragic Marker`; + } + const bLines = await wrapText(ctx, text, 88); + const bTopMost = 640 - (((fontSize * bLines.length) / 2) + ((2 * (bLines.length - 1)) / 2)); + for (let i = 0; i < bLines.length; i++) { + const height = bTopMost + ((fontSize + 2) * i); + ctx.fillText(bLines[i], 280, height); + } + return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'that-sign-wont-stop-me.png' }] }); + } +}; diff --git a/commands/edit-meme/tuxedo-pooh.js b/commands/edit-meme/tuxedo-pooh.js index ff8a290a..7edadefc 100644 --- a/commands/edit-meme/tuxedo-pooh.js +++ b/commands/edit-meme/tuxedo-pooh.js @@ -31,6 +31,11 @@ module.exports = class TuxedoPoohCommand extends Command { url: 'https://www.google.com/', reason: 'Noto Font', reasonURL: 'https://www.google.com/get/noto/' + }, + { + name: 'Overtime2005', + url: 'https://github.com/Overtime2005', + reason: 'Concept' } ], args: [ diff --git a/package.json b/package.json index 5e59ea22..9e6619ed 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "119.15.1", + "version": "119.16.0", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {