FridayNightFunkinBoyfriendBot/commands/cmdtest.js

79 lines
2.3 KiB
JavaScript
Raw Normal View History

2023-12-17 14:55:27 -05:00
const CommandError = require('../CommandModules/command_error')
const CommandSource = require('../CommandModules/command_source')
module.exports = {
2024-01-12 12:24:01 -05:00
name: 'cmdtest',
description:['usages are test and msg error'],
2023-12-20 11:54:03 -05:00
trustLevel: 0,
2024-01-12 12:24:01 -05:00
aliases:['cmdtst', 'commandtest', 'commandtst'],
2023-12-17 14:55:27 -05:00
execute (context) {
const bot = context.bot
const player = context.source.player.profile.name
const uuid = context.source.player.uuid
const message = context.arguments.join(' ') // WHY SECTION SIGNS!!
2024-01-12 12:24:01 -05:00
const args = context.arguments
switch (args[0]) {
case 'msg':
const component = {
2023-12-24 12:11:42 -05:00
translate: '[%s] %s %s %s %s %s',
with: [
{
translate: '%s%s%s',
bold:false,
with: [
{
text: 'FNF',
bold: true,
color: 'dark_purple'
},
{
text: 'Boyfriend',
bold: true,
color: 'aqua'
},
{
text: 'Bot',
bold: true,
color: 'dark_red'
},
],
clickEvent: bot.options.Core.customName ? { action: 'open_url', value: bot.options.Core.customName } : undefined,
hoverEvent: { action: 'show_text', contents: `idfk what to put here` }
},
{
text:'Hello, World!,'
},{
text:'Player:'
},
context.source.player.displayName ?? context.source.player.profile.name,
{
text:`, uuid: ${uuid}, `
},
//entry.displayName
2024-01-12 12:24:01 -05:00
{text:`Argument: ${args.slice(1).join(' ')}`}
2023-12-24 12:11:42 -05:00
]//command.split(' ')[0]
}
2024-01-12 12:24:01 -05:00
bot.tellraw([component])
break
case 'error':
throw new Error(args.slice(1).join(' '))
break
default:
context.source.sendError([{ text: 'Invalid action', color: 'dark_red', bold:false }])
context.source.sendError([{ text: 'the usages are msg and error', color: 'gray', bold:false }])
}
}
2023-12-17 14:55:27 -05:00
}
2023-12-24 12:11:42 -05:00
/*
2024-01-12 12:24:01 -05:00
2023-12-24 12:11:42 -05:00
*/
2023-12-17 14:55:27 -05:00
//context.source.player.displayName ?? context.source.player.profile.name,