diff options
author | destruc7i0n <6181960+destruc7i0n@users.noreply.github.com> | 2020-08-04 19:06:37 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-04 19:06:37 -0400 |
commit | 540db5bc3557ad3c96bea552bf746db3c5ce2ce8 (patch) | |
tree | 1ef488c03fc8cb4d981f6dc30111970c7201f844 | |
parent | Merge pull request #57 from FeikoJoosten/patch-1 (diff) | |
parent | Add nickname to variables obj (diff) | |
download | shulker-540db5bc3557ad3c96bea552bf746db3c5ce2ce8.tar.gz shulker-540db5bc3557ad3c96bea552bf746db3c5ce2ce8.zip |
Merge pull request #59 from MarshallOliver/master
Add nickname to variables obj
-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) } |