This Guy Command

This commit is contained in:
Dragon Fire
2020-06-15 15:54:38 -04:00
parent c205921956
commit b567297f57
4 changed files with 58 additions and 2 deletions
+3 -1
View File
@@ -227,7 +227,7 @@ in the appropriate channel's topic to use it.
## Commands
Total: 487
Total: 488
### Utility:
@@ -666,6 +666,7 @@ Total: 487
* **sora-selfie:** Draws an image or a user's avatar behind Sora taking a selfie.
* **sos:** Sends a "Esther Verkest's Help Sign" comic with the text of your choice.
* **spongebob-burn:** Sends a "Spongebob Throwing Something into a Fire" meme with words 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.
* **two-buttons:** Sends a "Two Buttons" meme with the buttons of your choice.
@@ -1521,6 +1522,7 @@ here.
* what-anime ([API](https://soruly.github.io/trace.moe/#/))
- [Warner Bros.](https://www.warnerbros.com/)
* phoebe-teaching-joey ([Images, Original "Friends" TV Series](https://www.warnerbros.com/tv/friends/))
* this-guy ([Image, Original "Friends" TV Series](https://www.warnerbros.com/tv/friends/))
- [Wattpad](https://www.wattpad.com/)
* wattpad ([API](https://www.wattpad.com/developer/docs/api))
- [Why We Protest](https://whyweprotest.net/)
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

+54
View File
@@ -0,0 +1,54 @@
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 ThisGuyCommand extends Command {
constructor(client) {
super(client, {
name: 'this-guy',
aliases: ['get-a-load-of-this-guy'],
group: 'edit-meme',
memberName: 'this-guy',
description: 'Draws an image or a user\'s avatar over the \"Get a load of this guy\" meme.',
throttling: {
usages: 1,
duration: 10
},
clientPermissions: ['ATTACH_FILES'],
credit: [
{
name: 'Warner Bros.',
url: 'https://www.warnerbros.com/',
reason: 'Image, Original "Friends" TV Series',
reasonURL: 'https://www.warnerbros.com/tv/friends/'
}
],
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', 'this-guy.png'));
const { body } = await request.get(image);
const data = await loadImage(body);
const canvas = createCanvas(base.width, base.height);
const ctx = canvas.getContext('2d');
ctx.drawImage(base, 0, 0);
const { x, y, width, height } = centerImagePart(data, 722, 722, 152, 123);
ctx.drawImage(data, x, y, width, height);
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'this-guy.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.28.0",
"version": "116.29.0",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {