mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-12 15:57:43 +02:00
Split Some Commands Up
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const request = require('superagent');
|
||||
|
||||
module.exports = class NSFWAnimeCommand extends Command {
|
||||
module.exports = class KonachanCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'nsfw-anime',
|
||||
name: 'konachan',
|
||||
group: 'randomimg',
|
||||
memberName: 'nsfw-anime',
|
||||
description: 'Sends a random (NSFW!) anime image.',
|
||||
memberName: 'konachan',
|
||||
description: 'Sends a random (Possibly NSFW!) anime image from Konachan.',
|
||||
guildOnly: true
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const request = require('superagent');
|
||||
|
||||
module.exports = class LolibooruCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'lolibooru',
|
||||
group: 'randomimg',
|
||||
memberName: 'lolibooru',
|
||||
description: 'Sends a random (Possibly NSFW!) anime image from Lolibooru.',
|
||||
guildOnly: true
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg) {
|
||||
if (!msg.channel.nsfw) return msg.say('This Command can only be used in NSFW Channels.');
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return msg.say('This Command requires the `Attach Files` Permission.');
|
||||
try {
|
||||
const { body } = await request
|
||||
.get('https://lolibooru.moe/post/index.json?tags=order:random&limit=1');
|
||||
return msg.channel.send({ files: [`https:${body[0].file_url}`] })
|
||||
.catch(err => msg.say(err));
|
||||
} catch (err) {
|
||||
return msg.say(err);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -83,7 +83,8 @@ module.exports = class InfoCommand extends Command {
|
||||
[random.cat](http://random.cat),
|
||||
[random.dog](https://random.dog),
|
||||
[fixer.io](http://fixer.io),
|
||||
[konachan](https://konachan.net)
|
||||
[konachan](https://konachan.net),
|
||||
[lolibooru](https://lolibooru.moe)
|
||||
`
|
||||
);
|
||||
return msg.embed(embed);
|
||||
|
||||
Reference in New Issue
Block a user