diff --git a/event/listeners/message.js b/event/listeners/message.js index 97d02ef1..2ad50dbd 100644 --- a/event/listeners/message.js +++ b/event/listeners/message.js @@ -56,11 +56,12 @@ class messageListener extends Listener { if (text.includes('[embed]')) { text = text.replace(/\[embed\]/, ' '); - let title; - let desc; + let title = ''; + let desc = ''; let image; let thumbnail; - let footer; + let footer = ''; + let color; if (text.includes('[embedImage:')) { image = text.split(/(\[embedImage:.*?])/); @@ -86,6 +87,18 @@ class messageListener extends Listener { } } + if (text.includes('[embedColor:')) { + color = text.split(/(\[embedColor:.*?])/); + for (let i = 0, l = color.length; i < l; i++) { + if (color[i].includes('[embedColor:')) { + color = color[i].replace('[embedColor:', '').slice(0, -1); + text = text.replace(/(\[embedColor:.*?])/g, ''); + i = color.length; + } + } + } + + if (text.includes('[embedTitle:')) { title = text.split(/(\[embedTitle:.*?])/); for (let i = 0, l = title.length; i < l; i++) { @@ -120,7 +133,7 @@ class messageListener extends Listener { } const embed = new MessageEmbed() - .setColor() + .setColor(color) .setTitle(title) .setImage(image) .setThumbnail(thumbnail)