mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-18 05:49:49 +02:00
Split Some Commands Up
This commit is contained in:
@@ -13,7 +13,7 @@ You can join the home server with [this link](https://discord.gg/fqQF8mc).
|
|||||||
[discord.js](https://discord.js.org), [commando](https://github.com/Gawdl3y/discord.js-commando), [zalgoize](https://github.com/clux/zalgolize), [superagent](https://visionmedia.github.io/superagent), [mathjs](http://mathjs.org), [moment](http://momentjs.com), [moment-duration-format](https://github.com/jsmreese/moment-duration-format), [jimp](https://github.com/oliver-moran/jimp), [cheerio](https://cheerio.js.org), [sequelize](http://docs.sequelizejs.com), [pg](https://github.com/brianc/node-postgres)
|
[discord.js](https://discord.js.org), [commando](https://github.com/Gawdl3y/discord.js-commando), [zalgoize](https://github.com/clux/zalgolize), [superagent](https://visionmedia.github.io/superagent), [mathjs](http://mathjs.org), [moment](http://momentjs.com), [moment-duration-format](https://github.com/jsmreese/moment-duration-format), [jimp](https://github.com/oliver-moran/jimp), [cheerio](https://cheerio.js.org), [sequelize](http://docs.sequelizejs.com), [pg](https://github.com/brianc/node-postgres)
|
||||||
|
|
||||||
## APIs
|
## APIs
|
||||||
[Wattpad](https://developer.wattpad.com), [Wordnik](http://developer.wordnik.com), [osu!](https://osu.ppy.sh/p/api), [memegen.link](https://memegen.link), [YuGiOh](http://docs.yugiohprices.apiary.io), [YouTube](https://developers.google.com/youtube), [Discord Bots](https://bots.discord.pw/api), [Today in History](http://history.muffinlabs.com/#api), [jService](http://jservice.io), [Urban Dictionary](https://github.com/zdict/zdict/wiki/Urban-dictionary-API-documentation), [OMDB](http://www.omdbapi.com), [Yahoo Weather](https://developer.yahoo.com/weather), [Google Maps](https://developers.google.com/maps), [Strawpoll](https://github.com/strawpoll/strawpoll/wiki/API), [rrrather](http://www.rrrather.com/botapi), [SoundCloud](https://developers.soundcloud.com), [random.cat](http://random.cat), [random.dog](https://random.dog), [fixer.io](http://fixer.io), [konachan](https://konachan.net)
|
[Wattpad](https://developer.wattpad.com), [Wordnik](http://developer.wordnik.com), [osu!](https://osu.ppy.sh/p/api), [memegen.link](https://memegen.link), [YuGiOh](http://docs.yugiohprices.apiary.io), [YouTube](https://developers.google.com/youtube), [Discord Bots](https://bots.discord.pw/api), [Today in History](http://history.muffinlabs.com/#api), [jService](http://jservice.io), [Urban Dictionary](https://github.com/zdict/zdict/wiki/Urban-dictionary-API-documentation), [OMDB](http://www.omdbapi.com), [Yahoo Weather](https://developer.yahoo.com/weather), [Google Maps](https://developers.google.com/maps), [Strawpoll](https://github.com/strawpoll/strawpoll/wiki/API), [rrrather](http://www.rrrather.com/botapi), [SoundCloud](https://developers.soundcloud.com), [random.cat](http://random.cat), [random.dog](https://random.dog), [fixer.io](http://fixer.io), [konachan](https://konachan.net), [lolibooru](https://lolibooru.moe)
|
||||||
|
|
||||||
## Licensing
|
## Licensing
|
||||||
The bot is licensed under an [ISC License](https://opensource.org/licenses/ISC). See the file `LICENSE.md` for more information.
|
The bot is licensed under an [ISC License](https://opensource.org/licenses/ISC). See the file `LICENSE.md` for more information.
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
const { Command } = require('discord.js-commando');
|
const { Command } = require('discord.js-commando');
|
||||||
const request = require('superagent');
|
const request = require('superagent');
|
||||||
|
|
||||||
module.exports = class NSFWAnimeCommand extends Command {
|
module.exports = class KonachanCommand extends Command {
|
||||||
constructor(client) {
|
constructor(client) {
|
||||||
super(client, {
|
super(client, {
|
||||||
name: 'nsfw-anime',
|
name: 'konachan',
|
||||||
group: 'randomimg',
|
group: 'randomimg',
|
||||||
memberName: 'nsfw-anime',
|
memberName: 'konachan',
|
||||||
description: 'Sends a random (NSFW!) anime image.',
|
description: 'Sends a random (Possibly NSFW!) anime image from Konachan.',
|
||||||
guildOnly: true
|
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.cat](http://random.cat),
|
||||||
[random.dog](https://random.dog),
|
[random.dog](https://random.dog),
|
||||||
[fixer.io](http://fixer.io),
|
[fixer.io](http://fixer.io),
|
||||||
[konachan](https://konachan.net)
|
[konachan](https://konachan.net),
|
||||||
|
[lolibooru](https://lolibooru.moe)
|
||||||
`
|
`
|
||||||
);
|
);
|
||||||
return msg.embed(embed);
|
return msg.embed(embed);
|
||||||
|
|||||||
@@ -53,6 +53,7 @@
|
|||||||
<li><a href="https://random.dog">random.dog</a></li>
|
<li><a href="https://random.dog">random.dog</a></li>
|
||||||
<li><a href="http://fixer.io">fixer.io</a></li>
|
<li><a href="http://fixer.io">fixer.io</a></li>
|
||||||
<li><a href="https://konachan.net">konachan</a></li>
|
<li><a href="https://konachan.net">konachan</a></li>
|
||||||
|
<li><a href="https://lolibooru.moe">lolibooru</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>Information</h2>
|
<h2>Information</h2>
|
||||||
<ul>
|
<ul>
|
||||||
|
|||||||
@@ -97,6 +97,7 @@
|
|||||||
<li><a href="https://random.dog">random.dog</a></li>
|
<li><a href="https://random.dog">random.dog</a></li>
|
||||||
<li><a href="http://fixer.io">fixer.io</a></li>
|
<li><a href="http://fixer.io">fixer.io</a></li>
|
||||||
<li><a href="https://konachan.net">konachan</a></li>
|
<li><a href="https://konachan.net">konachan</a></li>
|
||||||
|
<li><a href="https://lolibooru.moe">lolibooru</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<h2>Information</h2>
|
<h2>Information</h2>
|
||||||
<ul>
|
<ul>
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiaobot",
|
"name": "xiaobot",
|
||||||
"version": "18.7.0",
|
"version": "18.8.0",
|
||||||
"description": "A Discord Bot",
|
"description": "A Discord Bot",
|
||||||
"main": "shardingmanager.js",
|
"main": "shardingmanager.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user