From 053fcdb4b866ae3c1624bda5806ba63a2755b631 Mon Sep 17 00:00:00 2001 From: Isaac Date: Tue, 18 May 2021 23:07:38 +0100 Subject: [PATCH] Fix bug with empty topics --- src/commands/tag.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/commands/tag.js b/src/commands/tag.js index 4dab196..f5d5866 100644 --- a/src/commands/tag.js +++ b/src/commands/tag.js @@ -50,7 +50,7 @@ module.exports = class TagCommand extends Command { if (tag_name && settings.tags[tag_name]) { const tag = settings.tags[tag_name]; - const placeholders = [...tag.matchAll(/(? p[1]); + const placeholders = [...tag.matchAll(/(? p[1]); const requires_ticket = placeholders.some(p => p.startsWith('ticket.')); if (requires_ticket && !t_row) { @@ -103,8 +103,9 @@ module.exports = class TagCommand extends Command { if (requires_ticket) { args.ticket = t_row.toJSON(); - args.ticket.topic = this.client.cryptr.decrypt(args.ticket.topic); + args.ticket.topic = t_row.topic ? this.client.cryptr.decrypt(t_row.topic) : null; } + const text = tag.replace(/(? this.client.i18n.resolve(args, $1)); return await message.channel.send( new MessageEmbed()