summary refs log tree commit diff homepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/Discord.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Discord.ts b/src/Discord.ts
index 2893c8b..ffdd05b 100644
--- a/src/Discord.ts
+++ b/src/Discord.ts
@@ -140,13 +140,13 @@ 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 {
-    const possibleMentions = message.match(/@(\S+)/gim)
+    const possibleMentions = message.match(/@*.*#[0-9]{4}/gim)
     if (possibleMentions) {
       for (let mention of possibleMentions) {
         const mentionParts = mention.split('#')
db8ebf4877c91&follow=1'>Day 5, part 2June McEnroe 2017-12-05Day 5June McEnroe 2017-12-04Day 4, part 2June McEnroe 2017-12-04Day 4June McEnroe 2017-12-03Day 3, part 2June McEnroe 2017-12-03Day 3, clean upJune McEnroe 2017-12-03Day 3June McEnroe 2017-12-02Day 2, part 2June McEnroe 2017-12-02Day 2June McEnroe 2017-12-01Day 1, part 2June McEnroe 2017-12-01Day 1June McEnroe 2017-11-27Move to 2016 directoryJune McEnroe