From bd3461fddda0b96775727377627860bff75bd6ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Bersier?= Date: Thu, 9 May 2019 21:34:01 +0200 Subject: [PATCH] fixed missing : --- event/listeners/message.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/event/listeners/message.js b/event/listeners/message.js index 4c62f01..5ab0f0b 100644 --- a/event/listeners/message.js +++ b/event/listeners/message.js @@ -63,7 +63,7 @@ class messageListener extends Listener { let attach = ''; - if (text.includes('[attach')) { + if (text.includes('[attach:')) { attach = text.split(/(\[attach:.*?])/); for (let i = 0, l = attach.length; i < l; i++) { if (attach[i].includes('[attach:')) { @@ -71,7 +71,7 @@ class messageListener extends Listener { i = attach.length; } } - text = text.replace(/(\[attach:.*?])/, '') + text = text.replace(/(\[attach:.*?])/, ''); } // THIS SECTION IS VERY VERY BAD MUST CHANGE @@ -163,20 +163,20 @@ class messageListener extends Listener { .setTimestamp(); - if (attach) { - return message.channel.send(embed, {files: [attach]}); - } else { - return message.channel.send(embed); - } - } - - if (attach) { - return message.channel.send(text, {files: [attach]}); - } else { - return message.channel.send(text); - } + if (attach) { + return message.channel.send(embed, {files: [attach]}); + } else { + return message.channel.send(embed); + } + } + + if (attach) { + return message.channel.send(text, {files: [attach]}); + } else { + return message.channel.send(text); + } } - + } catch (err) { null; }