diff --git a/README.md b/README.md index e1968530..fafa1bbc 100644 --- a/README.md +++ b/README.md @@ -227,7 +227,7 @@ in the appropriate channel's topic to use it. ## Commands -Total: 485 +Total: 486 ### Utility: @@ -654,6 +654,7 @@ Total: 485 * **look-at-this-photograph:** Draws an image or a user's avatar over Nickelback's photograph. * **meme-gen-classic:** Sends a meme with the text and background of your choice. * **meme-gen-modern:** Sends a meme with the text and image of your choice. +* **my-collection-grows:** Sends a "My collection grows richer" Nekopara meme with the text of your choice. * **new-password:** Sends a "Weak Password/Strong Password" meme with the passwords of your choice. * **nike-ad:** Sends a "Believe in Something" Nike Ad meme with the text of your choice. * **phoebe-teaching-joey:** Sends a "Phoebe Teaching Joey" meme with text of your choice. @@ -1239,6 +1240,8 @@ here. * spongebob-time-card ([Spongeboytt1 Font](https://www.fontspace.com/spongeboytt1-font-f29761)) - [Neko Atsume: Kitty Collector](http://nekoatsume.com/en/) * neko-atsume-password (API, Original Game) +- [Nekopara](http://nekopara.com/main.html) + * my-collection-grows ([Image, Original Anime](https://nekopara-anime.com/)) - [Neopets](http://www.neopets.com/) * neopet (Pet Image Data, Original Game) * neopets-item (Original Game) diff --git a/assets/images/my-collection-grows.png b/assets/images/my-collection-grows.png new file mode 100644 index 00000000..eff04a47 Binary files /dev/null and b/assets/images/my-collection-grows.png differ diff --git a/commands/edit-meme/my-collection-grows.js b/commands/edit-meme/my-collection-grows.js new file mode 100644 index 00000000..b786471a --- /dev/null +++ b/commands/edit-meme/my-collection-grows.js @@ -0,0 +1,58 @@ +const Command = require('../../structures/Command'); +const { createCanvas, loadImage } = require('canvas'); +const request = require('node-superfetch'); +const path = require('path'); +const { centerImagePart } = require('../../util/Canvas'); + +module.exports = class MyCollectionGrowsCommand extends Command { + constructor(client) { + super(client, { + name: 'my-collection-grows', + aliases: ['my-collection-grows-richer', 'collection-grows', 'collection-grows-richer'], + group: 'edit-meme', + memberName: 'my-collection-grows', + description: 'Sends a "My collection grows richer" Nekopara meme with the text of your choice.', + throttling: { + usages: 1, + duration: 10 + }, + clientPermissions: ['ATTACH_FILES'], + credit: [ + { + name: 'Nekopara', + url: 'http://nekopara.com/main.html', + reason: 'Image, Original Anime', + reasonURL: 'https://nekopara-anime.com/' + } + ], + args: [ + { + key: 'image', + prompt: 'What image would you like to edit?', + type: 'image', + default: msg => msg.author.displayAvatarURL({ format: 'png', size: 256 }) + } + ] + }); + } + + async run(msg, { image }) { + try { + const base = await loadImage(path.join(__dirname, '..', '..', 'assets', 'images', 'my-collection-grows.png')); + const { body } = await request.get(image); + const avatar = await loadImage(body); + const canvas = createCanvas(base.width, base.height); + const ctx = canvas.getContext('2d'); + ctx.fillStyle = 'white'; + ctx.fillRect(0, 0, base.width, base.height); + ctx.drawImage(base, 0, 0); + ctx.rotate(-14 * (Math.PI / 180)); + const { x, y, width, height } = centerImagePart(avatar, 850, 850, 289, 358); + ctx.drawImage(avatar, x, y, width, height); + ctx.rotate(14 * (Math.PI / 180)); + return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'my-collection-grows.png' }] }); + } catch (err) { + return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); + } + } +}; diff --git a/package.json b/package.json index 1052b9a3..c2611f92 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "116.25.1", + "version": "116.26.0", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {