added footer

This commit is contained in:
Supositware 2019-02-10 01:50:42 +01:00
parent a2648e82ab
commit 9fa1b96ddd

View file

@ -60,6 +60,7 @@ class messageListener extends Listener {
let desc; let desc;
let image; let image;
let thumbnail; let thumbnail;
let footer;
if (text.includes('[embedImage:')) { if (text.includes('[embedImage:')) {
image = text.split(/(\[embedImage:.*?])/); image = text.split(/(\[embedImage:.*?])/);
@ -105,13 +106,13 @@ class messageListener extends Listener {
} }
} }
if (text.includes('[embedFooter:')) {
if (text.includes('[embedField:')) { footer = text.split(/(\[embedFooter:.*?])/);
desc = text.split(/(\[embedDesc:.*?])/); console.log(footer);
for (let i = 0, l = footer.length; i < l; i++) {
for (let i = 0, l = desc.length; i < l; i++) { if (footer[i].includes('[embedFooter:')) {
if (desc[i].includes('[embedDesc:')) { footer = footer[i].replace('[embedFooter:', '').slice(0, -1);
desc = desc[i].replace('[embedDesc:', '').slice(0, -1); i = footer.length;
} }
} }
} }
@ -122,6 +123,7 @@ class messageListener extends Listener {
.setImage(image) .setImage(image)
.setThumbnail(thumbnail) .setThumbnail(thumbnail)
.setDescription(desc) .setDescription(desc)
.setFooter(footer)
.setTimestamp(); .setTimestamp();