Add nickname support
This commit is contained in:
parent
8a27db4da5
commit
318f7cf858
2 changed files with 10 additions and 1 deletions
plugins
|
@ -26,6 +26,7 @@ module.exports = {
|
|||
const cmd = text.split(' ')
|
||||
const lang = settings.defaultLang
|
||||
const verify = hashcheck(cmd)
|
||||
const nickname = b.findDisplayName(uuid)
|
||||
if (verify > 0) {
|
||||
text = cmd.slice(0, cmd.length - 1).join(' ')
|
||||
}
|
||||
|
@ -45,7 +46,7 @@ module.exports = {
|
|||
return
|
||||
}
|
||||
try {
|
||||
cmds[cmd[0].toLowerCase()].execute(new Command(uuid, name, 'nick N/A', text, prefix, b, verify, userSettings))
|
||||
cmds[cmd[0].toLowerCase()].execute(new Command(uuid, name, nickname, text, prefix, b, verify, userSettings))
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
b.tellraw(uuid, {
|
||||
|
|
|
@ -48,5 +48,13 @@ module.exports = {
|
|||
}
|
||||
return '[[[[ no name ]]]]'
|
||||
}
|
||||
b.findDisplayName = (name) => {
|
||||
if(b.players[name]){
|
||||
const displayName = b.players[name].displayName.split(" ");
|
||||
return displayName[displayName.length-1]
|
||||
} else {
|
||||
return "[[[[ No display name ]]]]"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue