mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-07 06:45:31 +02:00
Fix parseString
This commit is contained in:
@@ -33,7 +33,7 @@ module.exports = class AnimeCommand extends Command {
|
||||
.query({
|
||||
q: query
|
||||
});
|
||||
const { anime } = await xml.parseString(text);
|
||||
const { anime } = await xml.parseStringAsync(text);
|
||||
const synopsis = anime.entry[0].synopsis[0].substr(0, 2000)
|
||||
.replace(/(<br \/>)/g, '')
|
||||
.replace(/(')/g, '\'')
|
||||
|
||||
@@ -33,7 +33,7 @@ module.exports = class GelbooruCommand extends Command {
|
||||
tags: query,
|
||||
limit: 1
|
||||
});
|
||||
const { posts } = await xml.parseString(text);
|
||||
const { posts } = await xml.parseStringAsync(text);
|
||||
if (posts.$.count === '0') throw new Error('No Results.');
|
||||
return msg.say(`Result for ${query}: https:${posts.post[0].$.file_url}`);
|
||||
} catch (err) {
|
||||
|
||||
@@ -33,7 +33,7 @@ module.exports = class MangaCommand extends Command {
|
||||
.query({
|
||||
q: query
|
||||
});
|
||||
const { manga } = await xml.parseString(text);
|
||||
const { manga } = await xml.parseStringAsync(text);
|
||||
const synopsis = manga.entry[0].synopsis[0].substr(0, 2000)
|
||||
.replace(/(<br \/>)/g, '')
|
||||
.replace(/(')/g, '\'')
|
||||
|
||||
@@ -33,7 +33,7 @@ module.exports = class Rule34Command extends Command {
|
||||
tags: query,
|
||||
limit: 1
|
||||
});
|
||||
const { posts } = await xml.parseString(text);
|
||||
const { posts } = await xml.parseStringAsync(text);
|
||||
if (posts.$.count === '0') throw new Error('No Results.');
|
||||
return msg.say(`Result for ${query}: https:${posts.post[0].$.file_url}`);
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user