Restore old eval functionality for console only (players can still see with formatting)
This commit is contained in:
parent
57f44cc73d
commit
f2fd8bc486
1 changed files with 29 additions and 25 deletions
|
@ -3,35 +3,39 @@ const { getMessage } = require('../util/lang.js')
|
|||
module.exports = {
|
||||
execute: (c) => {
|
||||
const item = eval(c.args.join(' '))
|
||||
c.reply({
|
||||
translate: '%s: %s',
|
||||
color: c.colors.primary,
|
||||
with: [
|
||||
{
|
||||
text: getMessage(c.lang, 'command.eval.output'),
|
||||
color: c.colors.secondary
|
||||
},
|
||||
{
|
||||
text: item + '',
|
||||
color: c.colors.primary,
|
||||
clickEvent: {
|
||||
action: 'copy_to_clipboard',
|
||||
value: item + ''
|
||||
if(c.type == "console"){
|
||||
console.log(item)
|
||||
} else {
|
||||
c.reply({
|
||||
translate: '%s: %s',
|
||||
color: c.colors.primary,
|
||||
with: [
|
||||
{
|
||||
text: getMessage(c.lang, 'command.eval.output'),
|
||||
color: c.colors.secondary
|
||||
},
|
||||
hoverEvent: {
|
||||
action: 'show_text',
|
||||
contents: {
|
||||
text: getMessage(c.lang, 'copyText'),
|
||||
color: c.colors.secondary
|
||||
{
|
||||
text: item + '',
|
||||
color: c.colors.primary,
|
||||
clickEvent: {
|
||||
action: 'copy_to_clipboard',
|
||||
value: item + ''
|
||||
},
|
||||
value: { // Added twice for backwards compatibility
|
||||
text: getMessage(c.lang, 'copyText'),
|
||||
color: c.colors.secondary
|
||||
hoverEvent: {
|
||||
action: 'show_text',
|
||||
contents: {
|
||||
text: getMessage(c.lang, 'copyText'),
|
||||
color: c.colors.secondary
|
||||
},
|
||||
value: { // Added twice for backwards compatibility
|
||||
text: getMessage(c.lang, 'copyText'),
|
||||
color: c.colors.secondary
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
]
|
||||
})
|
||||
}
|
||||
},
|
||||
level: 2
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue