From ecd9bff03cb6e760f1928c78423488c8863cc699 Mon Sep 17 00:00:00 2001 From: "Isaac (eartharoid)" Date: Thu, 15 Oct 2020 21:01:48 +0100 Subject: [PATCH] regex --- src/commands/new.js | 4 ++-- src/events/messageReactionAdd.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/commands/new.js b/src/commands/new.js index 74c93f3..b720e14 100644 --- a/src/commands/new.js +++ b/src/commands/new.js @@ -159,8 +159,8 @@ module.exports = { } let text = config.tickets.text - .replace('{{ name }}', message.author.username) - .replace('{{ tag }}', message.author); + .replace(/{{ ?name ?}}/gmi, message.author.username) + .replace(/{{ ?(tag|mention) ?}}/gmi, message.author); let w = await c.send( diff --git a/src/events/messageReactionAdd.js b/src/events/messageReactionAdd.js index 716221c..39d50ca 100644 --- a/src/events/messageReactionAdd.js +++ b/src/events/messageReactionAdd.js @@ -158,8 +158,8 @@ module.exports = { } let text = config.tickets.text - .replace('{{ name }}', u.username) - .replace('{{ tag }}', u); + .replace(/{{ ?name ?}}/gmi, u.username) + .replace(/{{ ?(tag|mention) ?}}/gmi, u); let w = await c.send(