mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Fix Commands
This commit is contained in:
@@ -37,7 +37,7 @@ module.exports = class GelbooruCommand extends Command {
|
||||
limit: 1
|
||||
});
|
||||
const { posts } = await xml(text);
|
||||
if (posts.count === 0) throw new Error('No Results.');
|
||||
if (!posts.$.count) throw new Error('No Results.');
|
||||
return msg.say(`Result for ${query}:`, { files: [`https:${posts.post[0].$.file_url}`] })
|
||||
.catch(err => msg.say(`${err.name}: ${err.message}`));
|
||||
} catch (err) {
|
||||
|
||||
@@ -37,8 +37,7 @@ module.exports = class Rule34Command extends Command {
|
||||
limit: 1
|
||||
});
|
||||
const { posts } = await xml(text);
|
||||
console.log(posts);
|
||||
if (posts.count === 0) throw new Error('No Results.');
|
||||
if (!posts.$.count) throw new Error('No Results.');
|
||||
return msg.say(`Result for ${query}:`, { files: [`https:${posts.post[0].$.file_url}`] })
|
||||
.catch(err => msg.say(`${err.name}: ${err.message}`));
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user