This commit is contained in:
Daniel Odendahl Jr
2018-12-08 12:48:56 +00:00
parent 8cb7e39f10
commit b8f18c441f
3 changed files with 2 additions and 43 deletions
+1 -2
View File
@@ -47,7 +47,7 @@ Xiao is a Discord bot coded in JavaScript with
7. Run `npm i -g pm2` to install PM2.
8. Run `pm2 start Xiao.js --name xiao` to run the bot.
## Commands (336)
## Commands (335)
### Utility:
* **eval:** Executes JavaScript code.
@@ -169,7 +169,6 @@ Xiao is a Discord bot coded in JavaScript with
* **esrb:** Searches ESRB for your query.
* **flickr:** Searches Flickr for your query.
* **forecast:** Responds with the seven-day forecast for a specific location.
* **gelbooru:** Responds with an image from Gelbooru, with optional query.
* **giphy:** Searches Giphy for your query.
* **github:** Responds with information on a GitHub repository.
* **google-autofill:** Responds with a list of the Google Autofill results for a particular query.
-40
View File
@@ -1,40 +0,0 @@
const Command = require('../../structures/Command');
const request = require('node-superfetch');
module.exports = class GelbooruCommand extends Command {
constructor(client) {
super(client, {
name: 'gelbooru',
group: 'search',
memberName: 'gelbooru',
description: 'Responds with an image from Gelbooru, with optional query.',
nsfw: true,
args: [
{
key: 'query',
prompt: 'What image would you like to search for?',
type: 'string',
default: ''
}
]
});
}
async run(msg, { query }) {
try {
const { body } = await request
.get('https://gelbooru.org/index.php')
.query({
page: 'dapi',
s: 'post',
q: 'index',
json: 1,
tags: query,
limit: 200
});
return msg.say(body[Math.floor(Math.random() * body.length)].file_url);
} catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
}
}
};
+1 -1
View File
@@ -29,7 +29,7 @@ module.exports = class KonachanCommand extends Command {
limit: 1
});
if (!body.length || !body[0].file_url) return msg.say('Could not find any results.');
return msg.say(`https:${body[0].file_url}`);
return msg.say(body[0].file_url);
} catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
}