From 6eab1831e9b5813f7d5719bbf1f6597255f0b6b5 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Mon, 1 Mar 2021 18:15:44 -0500 Subject: [PATCH] Inspiration Command --- README.md | 5 ++++- commands/random-img/inspiration.js | 33 ++++++++++++++++++++++++++++++ package.json | 2 +- 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 commands/random-img/inspiration.js diff --git a/README.md b/README.md index d5ce61de..9b472f51 100644 --- a/README.md +++ b/README.md @@ -270,7 +270,7 @@ in the appropriate channel's topic to use it. ## Commands -Total: 607 +Total: 608 ### Utility: @@ -407,6 +407,7 @@ Total: 607 * **food:** Responds with a randomly generated food. * **fox:** Responds with a random fox image. * **hentai:** Responds with a random hentai image. (NSFW) +* **inspiration:** Responds with a randomly generated inspiration. * **interesting:** Responds with a random interesting image. * **light-novel-cover:** Responds with a randomly generated Light Novel cover. (NSFW) * **lorem-picsum:** Responds with a random image of a certain size. @@ -1390,6 +1391,8 @@ here. * eject ([Original "Among Us" Game](https://innersloth.com/gameAmongUs.php)) - [Inside Scanlation](https://www.insidescanlation.com/) * chi-idea ([Wild Words Font](https://www.insidescanlation.com/etc/the-idiots-guide-to-editing-manga/guide/type/fonts.html)) +- [InspiroBot](https://inspirobot.me/) + * inspiration (API) - [ipify API](https://www.ipify.org/) * ip (API) - [iStock](https://www.istockphoto.com/) diff --git a/commands/random-img/inspiration.js b/commands/random-img/inspiration.js new file mode 100644 index 00000000..460e771b --- /dev/null +++ b/commands/random-img/inspiration.js @@ -0,0 +1,33 @@ +const Command = require('../../structures/Command'); +const request = require('node-superfetch'); + +module.exports = class InspirationCommand extends Command { + constructor(client) { + super(client, { + name: 'inspiration', + aliases: ['inspire', 'inspirobot'], + group: 'random-img', + memberName: 'inspiration', + description: 'Responds with a randomly generated inspiration.', + clientPermissions: ['ATTACH_FILES'], + credit: [ + { + name: 'InspiroBot', + url: 'https://inspirobot.me/', + reason: 'API' + } + ] + }); + } + + async run(msg) { + try { + const { text } = await request + .get('https://inspirobot.me/api') + .query({ generate: true }); + return msg.say({ files: [text] }); + } catch (err) { + return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`); + } + } +}; diff --git a/package.json b/package.json index aa09bedf..3640bada 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "131.1.1", + "version": "131.2.0", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {