From 14f61d88ffb5ac7f66d46e0155833d32d46802d6 Mon Sep 17 00:00:00 2001 From: Zachery Notz Date: Sat, 23 May 2020 17:14:31 -0700 Subject: Improved regex so that TELLRAW templates can use variables more than once --- src/Discord.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/Discord.ts b/src/Discord.ts index 2893c8b..c9b3b74 100644 --- a/src/Discord.ts +++ b/src/Discord.ts @@ -140,9 +140,9 @@ class Discord { } return this.config.MINECRAFT_TELLRAW_TEMPLATE - .replace('%username%', variables.username) - .replace('%discriminator%', variables.discriminator) - .replace('%message%', variables.text) + .replace(/%username%/g, variables.username) + .replace(/%discriminator%/g, variables.discriminator) + .replace(/%message%/g, variables.text) } private replaceDiscordMentions(message: string): string { -- cgit 1.4.1