mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-05 22:01:54 +02:00
Fix unspoiler nothing, Upgrade Yu-Gi-Oh API
This commit is contained in:
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "119.23.3",
|
||||
"version": "119.23.4",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user