I improved the regex for user mention detection to work with Discord users with spaces in their names. It now searches for any string that starts with an @ symbol and ends with a # sign with 4 numbers after it. /@.#[0-9]{4}/
I wanted to do a more complex tellraw where I used a variable more than once. However, only the first instance of a variable would be replaced. The changes I made replace ALL instances of each variable in a given MINECRAFT_TELLRAW_TEMPLATE
The example below is where I had to use this. The blue text when shift-clicked in game will populate the Minecraft chat prompt with discordusername#delimiter so the Minecraft user does not have to type out an entire desired discord user's username and delimiter manually to mention them.
Here is the TELLRAW used to test this
"MINECRAFT_TELLRAW_TEMPLATE": "[\"\",{\"text\":\"Discord \",\"bold\":true,\"color\":\"blue\"},{\"text\":\"<\"},{\"text\":\"%username%\",\"color\":\"aqua\",\"insertion\":\"@%username%#%discriminator% \"},{\"text\":\"> %message%\"}]",
This is what it looks like in game.
and in discord
If you like my template and want to add it to the repo as the default or as a suggestion in the readme, let me know and i'll add it to this pull request.
Tested on 2 x 24/7 servers
Does not conflict with pull request #55
Details:
Verified at https://regexr.com/ and in live server
The example below is where I had to use this. The blue text when shift-clicked in game will populate the Minecraft chat prompt with discordusername#delimiter so the Minecraft user does not have to type out an entire desired discord user's username and delimiter manually to mention them.
Here is the TELLRAW used to test this "MINECRAFT_TELLRAW_TEMPLATE": "[\"\",{\"text\":\"Discord \",\"bold\":true,\"color\":\"blue\"},{\"text\":\"<\"},{\"text\":\"%username%\",\"color\":\"aqua\",\"insertion\":\"@%username%#%discriminator% \"},{\"text\":\"> %message%\"}]",
This is what it looks like in game.
and in discord
If you like my template and want to add it to the repo as the default or as a suggestion in the readme, let me know and i'll add it to this pull request.