Re-add more commands

This commit is contained in:
7cc5c4f330d47060 2024-11-19 20:22:47 -05:00
parent 590b749bcb
commit 64590be691
Signed by: 7cc5c4f330d47060
SSH key fingerprint: SHA256:e+4tcZut1nBpe10PqjaO+Rvie0Q7W4qIvFzcUw+7riA
6 changed files with 94 additions and 0 deletions

6
commands/cb.js Executable file
View file

@ -0,0 +1,6 @@
const execute = (c) => {
c.bot.ccq.push(c.args.join(' '))
}
const consoleIndex = true
const aliases = ['commandblock', 'cmdblock']
export { execute, consoleIndex, aliases }

8
commands/logoff.js Executable file
View file

@ -0,0 +1,8 @@
const execute= (c) => {
c.reply("Command has been disabled")
//c.bot._client.end()
}
const consoleIndex= true
const level= 2
export { execute, consoleIndex, level }

57
commands/netmsg.js Executable file
View file

@ -0,0 +1,57 @@
import { bots } from '../index.js'
import { getMessage } from '../util/lang.js'
const execute = (c) => {
let host = c.host
let port = c.port
if (c.bot.host.options && c.bot.host.options.hidden) {
host = 'localhost' // Makes hidden servers appear as localhost
port = '25565'
} else if (c.bot.host.options && c.bot.host.options.displayAsIPv6) {
host = `[${host}]`
}
const json = {
translate: '[%s] %s: %s',
with: [
{
text: c.serverName,
hoverEvent: {
action: 'show_text',
value: {
translate: '%s: %s:%s',
with: [
{
text: getMessage(c.lang, 'command.netmsg.serverAddress'),
color: c.colors.primary
},
{
text: host,
color: c.colors.primary
},
{
text: port + '',
color: c.colors.primary
}
],
color: c.colors.secondary
}
},
color: c.colors.primary
},
{
text: c.username,
color: c.colors.primary
},
{
text: c.args.join(' ').slice(0, 512)
}
],
color: 'white'
}
bots.forEach(item => {
if (item.host.options && item.host.options.netmsgIncomingDisabled && c.type !== 'console') return
item.tellraw('@a', json)
})
}
export { execute }

7
commands/refill.js Executable file
View file

@ -0,0 +1,7 @@
const execute= (c) => {
c.bot.chat(c.bot.refillCoreCmd)
}
const consoleIndex= true
const aliases = ['refillcore', 'rc']
export { execute, consoleIndex, aliases }

8
commands/restart.js Executable file
View file

@ -0,0 +1,8 @@
const execute= (c) => {
c.reply("Command has been disabled")
//process.exit(0)
}
const aliases = ['reboot']
const level= 2
export { execute, aliases, level }

8
commands/stop.js Executable file
View file

@ -0,0 +1,8 @@
const execute= (c) => {
c.reply("Command has been disabled")
//process.exit(1)
}
const aliases = ['exit']
const level= 2
export { execute, aliases, level }