mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-05 08:12:04 +02:00
Fixes
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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!`);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -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!`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user