botv12/commands/test.js

49 lines
1.5 KiB
JavaScript
Raw Normal View History

2024-10-23 23:35:21 -04:00
import { getMessage } from '../util/lang.js'
const execute = (c) => {
const reply = function (name, item) {
return {
translate: '%s: %s',
color: c.colors.primary,
with: [
{
text: getMessage(c.lang, `command.test.${name}`),
color: c.colors.secondary
},
{
text: item,
color: c.colors.primary,
clickEvent: {
action: 'copy_to_clipboard',
value: item
},
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
}
}
}
]
}
}
c.reply(reply('uuid', c.uuid))
c.reply(reply('username', c.username))
c.reply(reply('nickname', c.nickname))
2024-10-27 01:24:39 -04:00
c.reply(reply('command', c.command.slice(0,1024)))
2024-10-23 23:35:21 -04:00
c.reply(reply('msgType', c.msgType))
c.reply(reply('msgSubtype', c.msgSubtype))
c.reply(reply('prefix', c.prefix))
2024-10-27 01:24:39 -04:00
c.reply(reply('args', c.args.join(', ').slice(0,1024)))
2024-10-23 23:35:21 -04:00
c.reply(reply('verify', c.verify.toString()))
c.reply(reply('host', c.host))
c.reply(reply('port', c.port.toString()))
c.reply(reply('lang', c.lang))
c.reply(reply('colorPrimary', c.colors.primary))
c.reply(reply('colorSecondary', c.colors.secondary))
}
export { execute }