A Girl Worth Fighting For Command

This commit is contained in:
Daniel Odendahl Jr
2018-11-07 23:28:50 +00:00
parent 9155098c76
commit 77cfe188e7
5 changed files with 49 additions and 3 deletions
+2 -1
View File
@@ -46,7 +46,7 @@ Xiao is a Discord bot coded in JavaScript with
6. Run `npm i -g pm2` to install PM2.
7. Run `pm2 start Xiao.js --name xiao` to run the bot.
## Commands (330)
## Commands (331)
### Utility:
* **eval:** Executes JavaScript code.
@@ -326,6 +326,7 @@ Xiao is a Discord bot coded in JavaScript with
* **distracted-boyfriend:** Draws three user's avatars over the "Distracted Boyfriend" meme.
* **drakeposting:** Draws two user's avatars over the "Drakeposting" meme.
* **food-broke:** Draws a user's avatar over the "Food Broke" meme.
* **girl-worth-fighting-for:** Draws a user's avatar as the object of Ling's affection.
* **hat:** Draws a hat over a user's avatar.
* **he-lives-in-you:** Draws a user's avatar over Simba from The Lion King's reflection.
* **i-have-the-power:** Draws a user's avatar over He-Man's face.
Binary file not shown.

After

Width:  |  Height:  |  Size: 413 KiB

@@ -0,0 +1,45 @@
const Command = require('../../structures/Command');
const { createCanvas, loadImage } = require('canvas');
const request = require('node-superfetch');
const path = require('path');
module.exports = class GirlWorthFightingForCommand extends Command {
constructor(client) {
super(client, {
name: 'girl-worth-fighting-for',
aliases: ['a-girl-worth-fighting-for', 'ling'],
group: 'avatar-edit',
memberName: 'girl-worth-fighting-for',
description: 'Draws a user\'s avatar as the object of Ling\'s affection.',
throttling: {
usages: 1,
duration: 10
},
clientPermissions: ['ATTACH_FILES'],
args: [
{
key: 'user',
prompt: 'Which user would you like to edit the avatar of?',
type: 'user',
default: msg => msg.author
}
]
});
}
async run(msg, { user }) {
const avatarURL = user.displayAvatarURL({ format: 'png', size: 256 });
try {
const base = await loadImage(path.join(__dirname, '..', '..', 'assets', 'images', 'girl-worth-fighting-for.png'));
const { body } = await request.get(avatarURL);
const avatar = await loadImage(body);
const canvas = createCanvas(base.width, base.height);
const ctx = canvas.getContext('2d');
ctx.drawImage(base, 0, 0);
ctx.drawImage(avatar, 380, 511, 150, 150);
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'girl-worth-fighting-for.png' }] });
} catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
}
}
};
+1 -1
View File
@@ -74,7 +74,7 @@ module.exports = class AkinatorCommand extends Command {
partner: '',
player: 'website-desktop',
uid_ext_session: '',
frontaddr: 'MTc4LjMzLjIzMS45OA==',
frontaddr: 'NDYuMTA1LjExMC40NQ==',
constraint: 'ETAT<>\'AV\'',
soft_constraint: channel.nsfw ? '' : 'ETAT=\'EN\'',
question_filter: channel.nsfw ? '' : 'cat=1'
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "98.0.4",
"version": "98.1.0",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {