diff options
author | Marshall Oliver <olivermt91@gmail.com> | 2020-08-04 15:42:25 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-04 15:42:25 -0400 |
commit | 017d0fd2b78e93cff65ed6e517d8ce7e95279c15 (patch) | |
tree | 1ef488c03fc8cb4d981f6dc30111970c7201f844 | |
parent | Merge pull request #57 from FeikoJoosten/patch-1 (diff) | |
download | shulker-017d0fd2b78e93cff65ed6e517d8ce7e95279c15.tar.gz shulker-017d0fd2b78e93cff65ed6e517d8ce7e95279c15.zip |
Add nickname to variables obj
To use, add %nickname% to your MINCRAFT_TELLRAW_TEMPLATE var in config.
Diffstat (limited to '')
-rw-r--r-- | src/Discord.ts | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/Discord.ts b/src/Discord.ts index ffdd05b..bb3b9a2 100644 --- a/src/Discord.ts +++ b/src/Discord.ts @@ -131,6 +131,7 @@ class Discord { private makeMinecraftTellraw(message: Message): string { const variables: {[index: string]: string} = { username: emojiStrip(message.author.username), + nickname: message.member.nickname ? emojiStrip(message.member.nickname) : emojiStrip(message.author.username), discriminator: message.author.discriminator, text: emojiStrip(message.cleanContent) } @@ -141,6 +142,7 @@ class Discord { return this.config.MINECRAFT_TELLRAW_TEMPLATE .replace(/%username%/g, variables.username) + .replace(/%nickname%/g, variables.nickname) .replace(/%discriminator%/g, variables.discriminator) .replace(/%message%/g, variables.text) } |