My Collection Grows Command

This commit is contained in:
Dragon Fire
2020-06-14 20:38:24 -04:00
parent 1ade33cfc4
commit f10684cc4e
4 changed files with 63 additions and 2 deletions
+4 -1
View File
@@ -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)
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 MiB

+58
View File
@@ -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!`);
}
}
};
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "116.25.1",
"version": "116.26.0",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {