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