diff --git a/README.md b/README.md index 2d59bf41..82524815 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,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 (343) +## Commands (344) ### Utility: * **eval:** Executes JavaScript code. @@ -119,6 +119,7 @@ Xiao is a Discord bot coded in JavaScript with * **suggest-command:** Suggests a random command for you to try. * **superpower:** Responds with a random superpower. * **this-for-that:** So, basically, it's like a bot command for this dumb meme. +* **waifu:** Responds with a randomly generated waifu and backstory. * **would-you-rather:** Responds with a random "Would you rather ...?" question. * **xiao:** Responds with a random image of Xiao Pai. diff --git a/commands/random/waifu.js b/commands/random/waifu.js new file mode 100644 index 00000000..4ff9ad22 --- /dev/null +++ b/commands/random/waifu.js @@ -0,0 +1,32 @@ +const Command = require('../../structures/Command'); +const { MessageEmbed } = require('discord.js'); +const request = require('node-superfetch'); +const { shorten } = require('../../util/Util'); + +module.exports = class WaifuCommand extends Command { + constructor(client) { + super(client, { + name: 'waifu', + aliases: ['this-waifu-does-not-exist'], + group: 'random', + memberName: 'waifu', + description: 'Responds with a randomly generated waifu and backstory.', + clientPermissions: ['EMBED_LINKS'], + credit: [ + { + name: 'This Waifu Does Not Exist', + url: 'https://www.thiswaifudoesnotexist.net/' + } + ] + }); + } + + async run(msg) { + const num = Math.floor(Math.random() * 100000); + const { text } = await request.get(`https://www.thiswaifudoesnotexist.net/snippet-${num}.txt`); + const embed = new MessageEmbed() + .setDescription(shorten(text)) + .setThumbnail(`https://www.thiswaifudoesnotexist.net/example-${num}.jpg`); + return msg.embed(embed); + } +}; diff --git a/package.json b/package.json index ce224937..c7be4a77 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "102.5.0", + "version": "102.6.0", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {