mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-20 21:44:48 +02:00
Remove NSFW Group
This commit is contained in:
@@ -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: 'random',
|
||||
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!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user