Fix unspoiler nothing, Upgrade Yu-Gi-Oh API

This commit is contained in:
Dragon Fire
2020-09-10 10:31:35 -04:00
parent 67b7970a64
commit a6903c88d8
3 changed files with 9 additions and 6 deletions
+4 -1
View File
@@ -4,6 +4,7 @@ module.exports = class UnspoilerCommand extends Command {
constructor(client) {
super(client, {
name: 'unspoiler',
aliases: ['unspoil'],
group: 'edit-text',
memberName: 'unspoiler',
description: 'Removes all spoilers from a message.',
@@ -18,6 +19,8 @@ module.exports = class UnspoilerCommand extends Command {
}
run(msg, { message }) {
return msg.say(message.content.replace(/\|\|([^|]+)\|\|/g, '$1'));
const unspoiled = message.content.replace(/\|\|([^|]+)\|\|/g, '$1');
if (!unspoiled.trim()) return msg.say('_ _');
return msg.say(unspoiled);
}
};
+4 -4
View File
@@ -39,19 +39,19 @@ module.exports = class YuGiOhCommand extends Command {
async run(msg, { card }) {
try {
const { body } = await request
.get('https://db.ygoprodeck.com/api/v4/cardinfo.php')
.get('https://db.ygoprodeck.com/api/v7/cardinfo.php')
.query({
name: card,
fname: card,
la: 'english'
});
const data = body[0][0];
const data = body.data[0];
const embed = new MessageEmbed()
.setColor(0xBE5F1F)
.setTitle(data.name)
.setURL(`https://db.ygoprodeck.com/card/?search=${data.id}`)
.setDescription(data.type === 'Normal Monster' ? `_${shorten(data.desc)}_` : shorten(data.desc))
.setAuthor('Yu-Gi-Oh!', 'https://i.imgur.com/AJNBflD.png', 'http://www.yugioh-card.com/')
.setThumbnail(data.image_url)
.setThumbnail(data.card_images.image_url)
.setFooter(data.id)
.addField(' Type', data.type, true)
.addField(data.type.includes('Monster') ? ' Race' : ' Spell Type', data.race, true);
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "119.23.3",
"version": "119.23.4",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {