Light Novel Cover Command

This commit is contained in:
Dragon Fire
2020-01-26 21:38:48 -05:00
parent 38bada553f
commit 4623598d4d
3 changed files with 41 additions and 2 deletions
+4 -1
View File
@@ -91,7 +91,7 @@ Xiao is a Discord bot coded in JavaScript with
## Commands
Total: 355
Total: 356
### Utility:
@@ -472,6 +472,7 @@ Total: 355
* **danbooru:** Responds with an image from Danbooru, with optional query.
* **dick:** Determines your dick size.
* **flickr:** Searches Flickr for your query... Maybe.
* **light-novel-cover:** Responds with a randomly generated Light Novel cover.
### Other:
@@ -747,6 +748,8 @@ here.
- [LMGTFY](https://lmgtfy.com/)
* google (API)
* lmgtfy (API)
- [LN cover generator](https://salty-salty-studios.com/shiz/lncovers.php)
* light-novel-cover (API)
- [LN title generator](https://salty-salty-studios.com/shiz/ln.php)
* light-novel-title (API)
- [MangaGamer.com](https://www.mangagamer.com/)
+36
View File
@@ -0,0 +1,36 @@
const Command = require('../../structures/Command');
const request = require('node-superfetch');
const cheerio = require('cheerio');
module.exports = class LightNovelCoverCommand extends Command {
constructor(client) {
super(client, {
name: 'light-novel-cover',
aliases: ['ln-cover'],
group: 'nsfw',
memberName: 'light-novel-cover',
description: 'Responds with a randomly generated Light Novel cover.',
nsfw: true,
credit: [
{
name: 'LN cover generator',
url: 'https://salty-salty-studios.com/shiz/lncovers.php',
reason: 'API'
}
]
});
}
async run(msg) {
try {
const { text } = await request.get('https://salty-salty-studios.com/shiz/lncovers.php');
const $ = cheerio.load(text);
const cover = $('img').first();
return msg.channel.send(cover.attr('alt'), {
files: [`https://salty-salty-studios.com/shiz/${cover.attr('src')}`]
});
} 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": "110.2.1",
"version": "110.3.0",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {