mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-24 22:34:46 +02:00
Fix
This commit is contained in:
@@ -31,7 +31,7 @@ module.exports = class SuperpowerCommand extends Command {
|
|||||||
const article = await this.fetchSuperpower(id);
|
const article = await this.fetchSuperpower(id);
|
||||||
return msg.reply(stripIndents`
|
return msg.reply(stripIndents`
|
||||||
Your superpower is... **${article.title}**!
|
Your superpower is... **${article.title}**!
|
||||||
_${article.abstract}_
|
_${article.abstract.split('1')[0].trim()}_
|
||||||
`);
|
`);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||||
@@ -55,7 +55,10 @@ module.exports = class SuperpowerCommand extends Command {
|
|||||||
async fetchSuperpower(id) {
|
async fetchSuperpower(id) {
|
||||||
const { body } = await request
|
const { body } = await request
|
||||||
.get('https://powerlisting.fandom.com/api/v1/Articles/Details')
|
.get('https://powerlisting.fandom.com/api/v1/Articles/Details')
|
||||||
.query({ ids: id });
|
.query({
|
||||||
|
ids: id,
|
||||||
|
abstract: 500
|
||||||
|
});
|
||||||
return body.items[id.toString()];
|
return body.items[id.toString()];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user