owobot/commands/eval.js

38 lines
1 KiB
JavaScript
Raw Normal View History

2024-08-03 03:00:04 -04:00
const index = require('../index.js') // Not used in the code, but may be used by users of the command
2024-09-06 17:31:33 -04:00
const { getMessage } = require('../util/lang.js')
2024-07-30 05:56:23 -04:00
module.exports = {
execute: (c) => {
2024-09-12 00:26:36 -04:00
const item = eval(c.args.join(' '))
2024-09-06 17:31:33 -04:00
c.reply({
translate: '%s: %s',
color: c.colors.primary,
with: [
{
2024-09-12 00:26:36 -04:00
text: getMessage(c.lang, 'command.eval.output'),
2024-09-06 17:31:33 -04:00
color: c.colors.secondary
},
{
2024-09-12 00:26:36 -04:00
text: item + '',
2024-09-06 17:31:33 -04:00
color: c.colors.primary,
clickEvent: {
action: 'copy_to_clipboard',
2024-09-12 00:26:36 -04:00
value: item + ''
2024-09-06 17:31:33 -04:00
},
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
}
}
}
]
})
2024-07-30 05:56:23 -04:00
},
2024-09-06 16:56:33 -04:00
level: 2
2024-07-30 05:56:23 -04:00
}