mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-07 06:45:31 +02:00
Light Novel Cover Command
This commit is contained in:
@@ -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/)
|
||||
|
||||
@@ -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
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "110.2.1",
|
||||
"version": "110.3.0",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user