diff --git a/README.md b/README.md index 5538792d..75379737 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/assets/images/girl-worth-fighting-for.png b/assets/images/girl-worth-fighting-for.png new file mode 100644 index 00000000..a593de0a Binary files /dev/null and b/assets/images/girl-worth-fighting-for.png differ diff --git a/commands/avatar-edit/girl-worth-fighting-for.js b/commands/avatar-edit/girl-worth-fighting-for.js new file mode 100644 index 00000000..b37567fe --- /dev/null +++ b/commands/avatar-edit/girl-worth-fighting-for.js @@ -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!`); + } + } +}; diff --git a/commands/games/akinator.js b/commands/games/akinator.js index bb24ad19..35cb9d9f 100644 --- a/commands/games/akinator.js +++ b/commands/games/akinator.js @@ -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' diff --git a/package.json b/package.json index 36c12f63..126620d9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "98.0.4", + "version": "98.1.0", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {