diff --git a/README.md b/README.md index e112a296..5068535e 100644 --- a/README.md +++ b/README.md @@ -132,7 +132,7 @@ in the appropriate channel's topic to use it. ## Commands -Total: 391 +Total: 392 ### Utility: @@ -421,6 +421,7 @@ Total: 391 * **glass-shatter:** Draws an image or a user's avatar with a glass shatter in front of it. * **glitch:** Draws an image or a user's avatar but glitched. * **greyscale:** Draws an image or a user's avatar in greyscale. +* **hollywood-star:** Sends a Hollywood Walk of Fame star with the name of your choice. * **ifunny:** Draws an image with the iFunny logo. * **invert:** Draws an image or a user's avatar but inverted. * **minecraft-skin:** Sends the Minecraft skin for a user. @@ -629,6 +630,8 @@ here. * adorable (API) - [Advice Slip](https://adviceslip.com/) * advice ([API](https://api.adviceslip.com/)) +- [Alexey Star](https://alexeystar.com/) + * hollywood-star ([Hollywood Star Font](https://alexeystar.com/hollywood-star-font/)) - [Alpha Vantage](https://www.alphavantage.co/) * stocks (API) - [Andrew Tyler](https://www.dafont.com/andrew-tyler.d2526) @@ -787,6 +790,8 @@ here. * scrabble-score ([Original Scrabble Game](https://scrabble.hasbro.com/en-us)) - [hbl917070](https://github.com/hbl917070) * axis-cult-sign-up ([Font](https://github.com/hbl917070/Konosuba-text)) +- [Hollywood Walk of Fame](https://walkoffame.com/) + * hollywood-star (Concept) - [Horst Faas](https://en.wikipedia.org/wiki/Horst_Faas) * vietnam-flashbacks (Image) - [HTTP Cats](https://http.cat/) @@ -1010,6 +1015,8 @@ here. * subreddit ([API](https://www.reddit.com/dev/api/)) - [Redeeming God](https://redeeminggod.com/) * approved ([Image](https://redeeminggod.com/courses/gospel-dictionary/lessons/gospel-dictionary-approved/)) +- [RedKid.Net](http://www.redkid.net/) + * hollywood-star ([Image](http://www.redkid.net/generator/star/)) - [Rest Countries](https://restcountries.eu/) * country (API) - [Right Stuf Anime](https://www.rightstufanime.com/) diff --git a/assets/fonts/HollywoodStar.otf b/assets/fonts/HollywoodStar.otf new file mode 100644 index 00000000..87a5b65b Binary files /dev/null and b/assets/fonts/HollywoodStar.otf differ diff --git a/assets/images/hollywood-star.jpg b/assets/images/hollywood-star.jpg new file mode 100644 index 00000000..dd4e3adf Binary files /dev/null and b/assets/images/hollywood-star.jpg differ diff --git a/commands/edit-image/hollywood-star.js b/commands/edit-image/hollywood-star.js new file mode 100644 index 00000000..53ecd8f0 --- /dev/null +++ b/commands/edit-image/hollywood-star.js @@ -0,0 +1,61 @@ +const Command = require('../../structures/Command'); +const { createCanvas, loadImage, registerFont } = require('canvas'); +const path = require('path'); +registerFont(path.join(__dirname, '..', '..', 'assets', 'fonts', 'HollywoodStar.otf'), { family: 'Hollywood Star' }); + +module.exports = class HollywoodStarCommand extends Command { + constructor(client) { + super(client, { + name: 'hollywood-star', + aliases: ['hollywood', 'walk-of-fame', 'walk-of-fame-star'], + group: 'edit-image', + memberName: 'hollywood-star', + description: 'Sends a Hollywood Walk of Fame star with the name of your choice.', + throttling: { + usages: 1, + duration: 10 + }, + clientPermissions: ['ATTACH_FILES'], + credit: [ + { + name: 'RedKid.Net', + url: 'http://www.redkid.net/', + reason: 'Image', + reasonURL: 'http://www.redkid.net/generator/star/' + }, + { + name: 'Alexey Star', + url: 'https://alexeystar.com/', + reason: 'Hollywood Star Font', + reasonURL: 'https://alexeystar.com/hollywood-star-font/' + }, + { + name: 'Hollywood Walk of Fame', + url: 'https://walkoffame.com/', + reason: 'Concept' + } + ], + args: [ + { + key: 'name', + prompt: 'What name should be on the star?', + type: 'string', + max: 30 + } + ] + }); + } + + async run(msg, { name }) { + const base = await loadImage(path.join(__dirname, '..', '..', 'assets', 'images', 'hollywood-star.png')); + const canvas = createCanvas(base.width, base.height); + const ctx = canvas.getContext('2d'); + ctx.drawImage(base, 0, 0); + ctx.font = '28px Hollywood Star'; + ctx.fillStyle = '#fadfd4'; + ctx.textAlign = 'center'; + ctx.textBaseline = 'top'; + ctx.fillText(name.toLowerCase(), 288, 140); + return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'hollywood-star.png' }] }); + } +}; diff --git a/package.json b/package.json index 5eb7d286..75732e0e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "113.5.0", + "version": "113.6.0", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {