I meant something like what's mentioned here (for an addon):
https://wow.gamepedia.com/UI_escape_sequences
scroll down to the player part:
player
player : name : lineID : chatType : [chatTarget]
lineID Message ID for reporting.
Examples:
"|Hplayer:Kilastra-DefiasBrotherhood:90:CHANNEL:2|h[|cff8686ecKilastra|r]|h"
"|Hplayer:Ketho-Anasterian:8:PARTY:|h[|cfffefefeKetho|r]|h"
|
I was able to do it using the example above but I don't understand the lineID: chatType parts.
I replaced the name I wanted here but I don't know what "90:CHANNEL:2" means and if it's ok to just use it for everything.
"|Hplayer:Kilastra-DefiasBrotherhood:90:CHANNEL:2|h[|cff8686ecKilastra|r]|h"
Like this:
DEFAULT_CHAT_FRAME:AddMessage("|Hplayer:Moonscarlet-ServerName:90:CHANNEL:2|hMoonscarlet|h");