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);
}
};