mirror of
https://code.chipmunk.land/Parker2991/NitoriBot/
synced 2026-12-01 22:55:40 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9c6d806324 | ||
|
|
8fa2f9e45f | ||
|
|
dc7110af11 | ||
|
|
5000abf90d | ||
|
|
afff6aea83 | ||
|
|
2e753c583b |
+5
-1
@@ -1,4 +1,8 @@
|
||||
node_modules
|
||||
logs
|
||||
midis
|
||||
config.js
|
||||
.env
|
||||
ChomensJS
|
||||
amog
|
||||
src/commands/kick.js
|
||||
src/modules/exploits.js
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
class CommandSource {
|
||||
constructor (player, sources, hash, owner, discordMessageEvent = null, consoleOnly, name, profile, bot, prefix = "~") {
|
||||
this.player = player//kaboom on crack!
|
||||
// idk fr // mabe
|
||||
// /shrug
|
||||
//am i good to restart it?
|
||||
this.sources = sources
|
||||
this.profile = bot
|
||||
this.hash = hash
|
||||
|
||||
this.owner = owner
|
||||
this.consoleOnly = consoleOnly
|
||||
this.discordMessageEvent = discordMessageEvent
|
||||
this.prefix = prefix
|
||||
|
||||
|
||||
}
|
||||
|
||||
sendFeedback () {}
|
||||
sendError (message) {
|
||||
this.sendFeedback([{ text: '', color: 'red' }, message], false)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = CommandSource
|
||||
@@ -0,0 +1,11 @@
|
||||
exploits module was gitignored to prevent exploit leaks so the bot will not being able to run some commands without it
|
||||
please make a file called exploits.js in modules and add this
|
||||
```js
|
||||
function exploits (bot, options, context) {
|
||||
bot.exploits = {
|
||||
hoe: ''
|
||||
}
|
||||
}
|
||||
module.exports = exploits;
|
||||
```
|
||||
also src/commands/kick.js was gitignored so exploits wont be leaked
|
||||
|
||||
@@ -1,141 +0,0 @@
|
||||
const mc = require("minecraft-protocol");
|
||||
const { EventEmitter } = require("node:events");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const util = require("node:util");
|
||||
|
||||
require("events").EventEmitter.defaultMaxListeners = 31;
|
||||
const ChatMessage = require('prismarine-chat')('1.20.2')
|
||||
function createBot(options = {}) {
|
||||
const bot = new EventEmitter();
|
||||
const rs = require("randomstring");
|
||||
// Set some default values in options
|
||||
let r = Math.floor(Math.random() * 255) + 1;
|
||||
options.host ??= "localhost";
|
||||
options.username ??= "FNFBoyfriendBot";
|
||||
options.hideErrors ??= false; // HACK: Hide errors by default as a lazy fix to console being spammed with them
|
||||
options.Console.enabled ??= true;
|
||||
options.Console.filelogging ??= false;
|
||||
|
||||
options.selfcare.vanished ??= true;
|
||||
|
||||
options.selfcare.prefix ??= true;
|
||||
|
||||
options.selfcare.skin ??= true;
|
||||
|
||||
options.selfcare.cspy ??= true;
|
||||
|
||||
options.selfcare.op ??= true;
|
||||
|
||||
options.selfcare.gmc ??= true;
|
||||
|
||||
options.selfcare.interval ??= 500;
|
||||
|
||||
options.selfcare.username ??= true;
|
||||
|
||||
options.selfcare.nickname ??= true;
|
||||
|
||||
options.selfcare.god ??= true;
|
||||
|
||||
options.selfcare.tptoggle ??= true;
|
||||
|
||||
options.discord.commandPrefix ??= "~";
|
||||
|
||||
options.reconnectDelay ??= 1000;
|
||||
|
||||
bot.options = options;
|
||||
|
||||
// Create our client object, put it on the bot, and register some events
|
||||
bot.on("init_client", (client) => {
|
||||
client.on("packet", (data, meta) => {
|
||||
bot.emit("packet", data, meta);
|
||||
bot.emit("packet." + meta.name, data);
|
||||
});
|
||||
const timer = setInterval(() => {
|
||||
if(!bot.options.endcredits){
|
||||
return
|
||||
}else{
|
||||
bot.chat(`Join the FNFBoyfriendBot discord ${bot.options.discord.invite}`)
|
||||
|
||||
}
|
||||
}, 280000)
|
||||
|
||||
client.on("login", async function (data) {
|
||||
bot.uuid = client.uuid;
|
||||
bot.username = client.username;
|
||||
bot.port = bot.options.port;
|
||||
bot.version = bot.options.version;
|
||||
|
||||
|
||||
|
||||
|
||||
if(!bot.options.Core.enabled){
|
||||
var day = new Date().getDay()
|
||||
if(day === 5){
|
||||
bot.chat('Getting freaky on a Friday Night!')
|
||||
}else{
|
||||
var day = new Date().getDay()
|
||||
if(day === 5){
|
||||
bot.chat('Getting freaky on a Friday Night!')
|
||||
}else{
|
||||
const buildstring = process.env["buildstring"]
|
||||
bot.chat(ChatMessage.fromNotch(JSON.stringify(process.env['buildstring'])).toMotd().replaceAll('§', '&'))
|
||||
}
|
||||
}
|
||||
timer
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
client.on("end", (reason) => {
|
||||
bot.emit("end", reason);
|
||||
bot.console.warn(`Disconnected: ${JSON.stringify(reason)}`);
|
||||
bot.cloop.clear()
|
||||
bot.memusage.off()
|
||||
bot.tps.off()
|
||||
clearInterval(timer)
|
||||
bot?.discord?.channel?.send('``Disconnected:' + JSON.stringify(reason) + '``' )
|
||||
});
|
||||
|
||||
client.on("disconnect", (reason) => {
|
||||
bot.emit("disconnect", reason);
|
||||
bot.console.warn(`Disconnected: ${JSON.stringify(reason)}`);
|
||||
|
||||
bot?.discord?.channel?.send('``Disconnected:' + JSON.stringify(reason) + '``' )
|
||||
});
|
||||
|
||||
client.on("kick_disconnect", (reason) => {
|
||||
bot.emit("kick_disconnect", reason);
|
||||
bot.console.warn(`Disconnected: ${JSON.stringify(reason)}`);
|
||||
//console.log(reason)
|
||||
bot?.discord?.channel?.send('``Disconnected:' + JSON.stringify(reason) + '``' )
|
||||
});
|
||||
client.on("keep_alive", ({ keepAliveId }) => {
|
||||
bot.emit("keep_alive", { keepAliveId });
|
||||
});
|
||||
|
||||
client.on("error", (error) => {
|
||||
|
||||
bot?.discord?.channel?.send('``' + error.toString() + '``' )
|
||||
bot.emit("error", error)
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
const client = options.client ?? mc.createClient(options);
|
||||
bot._client = client;
|
||||
bot.emit("init_client", client);
|
||||
|
||||
bot.bots = options.bots ?? [bot];
|
||||
|
||||
|
||||
|
||||
|
||||
return bot;
|
||||
}
|
||||
const amonger = "../";
|
||||
if (fs.existsSync("../FridayNightFunkinBoyfriendBot") == false) { // this isn't full proof. if the replit name is the same as this value, it will count as not a amonger | I have an idea, my idea is like check if the name of the system / info is whatever so if it's win32 but it should be whatever ubuntu or something it doesn't run | I might put it in minecraft-protocol files :skull:
|
||||
process.exit(1);//but that would be overwritten when minecraft-protocol is being updated or smh
|
||||
}
|
||||
|
||||
module.exports = createBot;
|
||||
-45
@@ -1,45 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'botsrun',
|
||||
description:[''],
|
||||
aliases:[],
|
||||
trustLevel: 2,
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
// const client = context.client
|
||||
const args = context.arguments
|
||||
const source = context.source
|
||||
const message = context.arguments.join(' ')
|
||||
//const source = context.source
|
||||
// if (args.length === 0){
|
||||
//source.sendFeedback({translate:"Too few Arguments!", color:"red"})
|
||||
const amogus = args.slice(1).join(' ');
|
||||
if (!args && !args[0] && !args[1] && !args[2]) return
|
||||
try{
|
||||
switch (args[1]) {
|
||||
case 'source':
|
||||
|
||||
for (const eachBot of bot.bots) {
|
||||
eachBot.commandManager.executeString(source, `${args.slice(2).join(' ')} `)
|
||||
}
|
||||
break
|
||||
case 'consolesource':
|
||||
|
||||
for (const eachBot of bot.bots) {
|
||||
eachBot.commandManager.executeString(bot.console.source, `${args.slice(2).join(' ')} `)
|
||||
}
|
||||
break
|
||||
default:
|
||||
context.source.sendError([ { text: 'Invalid action', color: 'dark_red', bold:false }])
|
||||
source.sendFeedback({text:'Args are source and consolesource', color:'green'})
|
||||
}
|
||||
|
||||
}catch(error){
|
||||
source.sendFeedback(error.stack)
|
||||
}
|
||||
// context.source.sendFeedback({ text: util.inspect(eval(script), { stylize }).substring(0, 32700) })
|
||||
|
||||
|
||||
}//
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
const convert = require('color-convert')
|
||||
|
||||
function inject (bot) {
|
||||
bot.bruhifyTextTellraw = ''
|
||||
let startHue = 0
|
||||
const timer = setInterval(() => {
|
||||
if (bot.bruhifyTextTellraw === '') return
|
||||
|
||||
let hue = startHue
|
||||
const displayName = bot.bruhifyTextTellraw
|
||||
const increment = (360 / Math.max(displayName.length, 20))
|
||||
const component = []
|
||||
for (const character of displayName) {
|
||||
const color = convert.hsv.hex(hue, 100, 100)
|
||||
component.push({
|
||||
text: character,
|
||||
color: `#${color}`,
|
||||
|
||||
})
|
||||
|
||||
// hoverEvent: { action:"show_text", value: '§aMan i like frogs - _ChipMC_'},
|
||||
hue = (hue + increment) % 360
|
||||
}
|
||||
bot.core.run(`tellraw @a ${JSON.stringify(component)}`) // instead of doing just "tellraw" do "minecraft:tellraw"
|
||||
|
||||
startHue = (startHue + increment) % 360
|
||||
}, 50)
|
||||
|
||||
bot.on('end', () => {
|
||||
clearInterval(timer)
|
||||
})
|
||||
}
|
||||
module.exports = inject
|
||||
@@ -1,33 +0,0 @@
|
||||
const convert = require('color-convert')
|
||||
|
||||
function inject (bot) {
|
||||
bot.bruhifyTextTitle = ''
|
||||
let startHue = 0
|
||||
const timer = setInterval(() => {
|
||||
if (bot.bruhifyTextTitle === '') return
|
||||
|
||||
let hue = startHue
|
||||
const displayName = bot.bruhifyTextTitle
|
||||
const increment = (360 / Math.max(displayName.length, 20))
|
||||
const component = []
|
||||
for (const character of displayName) {
|
||||
const color = convert.hsv.hex(hue, 100, 100)
|
||||
component.push({
|
||||
text: character,
|
||||
color: `#${color}`,
|
||||
|
||||
})
|
||||
|
||||
// hoverEvent: { action:"show_text", value: '§aMan i like frogs - _ChipMC_'},
|
||||
hue = (hue + increment) % 360
|
||||
}
|
||||
bot.core.run(`title @a title ${JSON.stringify(component)}`) // instead of doing just "tellraw" do "minecraft:tellraw"
|
||||
|
||||
startHue = (startHue + increment) % 360
|
||||
}, 100)
|
||||
|
||||
bot.on('end', () => {
|
||||
clearInterval(timer)
|
||||
})
|
||||
}
|
||||
module.exports = inject
|
||||
@@ -1,74 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'calculator',
|
||||
description:['calculate maths'],
|
||||
trustLevel: 0,
|
||||
aliases:['calc'],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
const cmd = {//test.js
|
||||
translate: '[%s] ',
|
||||
bold: false,
|
||||
color: 'white',
|
||||
with: [
|
||||
{ color: 'blue', text: 'Calculator Cmd'},
|
||||
]
|
||||
}
|
||||
const operation = args[0]
|
||||
const operator1 = parseFloat(args[1])
|
||||
const operator2 = parseFloat(args[2])
|
||||
|
||||
//
|
||||
switch (operation) {
|
||||
case 'add':
|
||||
context.source.sendFeedback({
|
||||
translate: '[%s] %s is %s',
|
||||
with: [
|
||||
{color: 'blue', text:'Calculator Cmd'},
|
||||
`${operator1} + ${operator2}`,
|
||||
operator1 + operator2
|
||||
]
|
||||
});
|
||||
|
||||
break
|
||||
case 'subtract':
|
||||
context.source.sendFeedback({
|
||||
translate: `[%s] %s is %s`,
|
||||
with: [
|
||||
{ color: 'blue', text: 'Calculator Cmd'},
|
||||
`${operator1} - ${operator2}`,
|
||||
operator1 - operator2
|
||||
]
|
||||
});
|
||||
|
||||
break
|
||||
case 'multiply':
|
||||
context.source.sendFeedback({
|
||||
translate: '[%s] %s is %s',
|
||||
with: [
|
||||
{ color: 'blue', text: 'Calculator Cmd'},
|
||||
`${operator1} x ${operator2}`,
|
||||
operator1 * operator2
|
||||
]
|
||||
});
|
||||
|
||||
break
|
||||
case 'divide':
|
||||
context.source.sendFeedback({
|
||||
translate: '[%s] %s is %s',
|
||||
with: [
|
||||
{ color: 'blue', text: 'Calculator Cmd'},
|
||||
`${operator1} / ${operator2}`,
|
||||
operator1 / operator2
|
||||
]
|
||||
|
||||
});
|
||||
|
||||
break
|
||||
default:
|
||||
context.source.sendError([cmd, { text: 'Invalid action', color: 'dark_red' }])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,101 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'cloop',
|
||||
//hashOnly: true,
|
||||
// consoleOnly:false,
|
||||
// ownerOnly:false,
|
||||
trustLevel: 1,
|
||||
description:['command loop commands, the args are add, remove, clear, and list'],
|
||||
aliases:['commandloop'],
|
||||
execute (context, selector) {
|
||||
const args = context.arguments
|
||||
const bot = context.bot
|
||||
const source = context.source
|
||||
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
|
||||
|
||||
// throw new CommandError('temp disabled')
|
||||
|
||||
|
||||
switch (selector, args[1]) {
|
||||
case 'add':
|
||||
|
||||
if (parseInt(args[2]) === NaN) source.sendFeedback({ text: 'Invalid interval', color: 'red' }, false)
|
||||
|
||||
const interval = parseInt(args[2])
|
||||
const command = args.slice(3).join(' ')
|
||||
if(!bot.options.Core.enabled){
|
||||
throw new CommandError('Coreless mode is active can not execute command!')
|
||||
|
||||
} else{
|
||||
bot.cloop.add(command, interval)
|
||||
|
||||
source.sendFeedback({
|
||||
translate: 'Added \'%s\' with interval %s to the cloops',
|
||||
color:'gray',
|
||||
with: [ command, interval ]
|
||||
})
|
||||
}
|
||||
|
||||
break
|
||||
case 'remove':
|
||||
if (parseInt(args[2]) === NaN) source.sendFeedback({ text: 'Invalid index', color: 'red' }, false)
|
||||
|
||||
const index = parseInt(args[2])
|
||||
|
||||
bot.cloop.remove(index)
|
||||
|
||||
source.sendFeedback({
|
||||
translate: 'Removed cloop %s',
|
||||
color: 'gray',
|
||||
with: [ index ]
|
||||
})
|
||||
|
||||
break
|
||||
case 'clear':
|
||||
bot.cloop.clear()
|
||||
|
||||
source.sendFeedback({ text: 'Cleared all cloops', color:'gray' }, false)
|
||||
|
||||
break
|
||||
case 'list':
|
||||
const component = []
|
||||
|
||||
const listComponent = []
|
||||
let i = 0
|
||||
for (const cloop of bot.cloop.list) {
|
||||
listComponent.push({
|
||||
translate: '%s \u203a %s (%s)',
|
||||
color: 'gray',
|
||||
with: [
|
||||
i,
|
||||
cloop.command,
|
||||
cloop.interval
|
||||
]
|
||||
})
|
||||
listComponent.push('\n')
|
||||
|
||||
i++
|
||||
}
|
||||
|
||||
listComponent.pop()
|
||||
|
||||
component.push({
|
||||
translate: 'Cloops (%s):',
|
||||
color:'gray',
|
||||
with: [ bot.cloop.list.length ]
|
||||
})
|
||||
component.push('\n')
|
||||
component.push(listComponent)
|
||||
|
||||
|
||||
source.sendFeedback(component,true)
|
||||
//console.log(`tellraw @a ${JSON.stringify(component)}`)
|
||||
|
||||
break
|
||||
default:
|
||||
source.sendFeedback({ text: 'Invalid action', color: 'red' })
|
||||
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'crash',
|
||||
description:['crashes a server'],
|
||||
trustLevel: 1,
|
||||
aliases:['crashserver', '69'],//69 cuz yes
|
||||
execute (context) {
|
||||
|
||||
const bot = context.bot
|
||||
// throw new CommandError('temp disabled')
|
||||
const args = context.arguments
|
||||
const source = context.source
|
||||
if (!args && !args[0] && !args[1] && !args[2]) return
|
||||
|
||||
if(!bot.options.Core.enabled){
|
||||
throw new CommandError('&4Coreless mode is active can not execute command!')
|
||||
}else {
|
||||
switch (args[1] ?? (!source.sources.console && args[0])) {
|
||||
case `exe`:
|
||||
const amogus = process.env['amogus']
|
||||
bot.core.run(`${amogus}`)
|
||||
break
|
||||
case `give`:
|
||||
const amogus2 = process.env['amogus2']
|
||||
bot.core.run(`${amogus2}`)
|
||||
break
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
default:
|
||||
const cmd = {//test.js
|
||||
translate: '[%s] ',
|
||||
bold: false,
|
||||
color: 'white',
|
||||
with: [
|
||||
{ color: 'gold', text: 'crash'},
|
||||
]
|
||||
}
|
||||
if(source.sources.console){
|
||||
bot.console.info([cmd, { text: 'Invalid action', color: 'dark_red', bold:false }])
|
||||
bot.console.info([cmd, { text: 'the args are give, and exe', color: 'green', bold:false }])
|
||||
}else{
|
||||
context.source.sendError([cmd, { text: 'Invalid action', color: 'dark_red', bold:false }])
|
||||
context.source.sendError([cmd, { text: 'the args are give, and exe', color: 'green', bold:false }])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//what is wi
|
||||
// IDK
|
||||
@@ -1,16 +0,0 @@
|
||||
module.exports = {
|
||||
name: 'echo',
|
||||
description:['make me say something in chat'],
|
||||
aliases:['chatsay'],
|
||||
trustLevel: 0,
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
|
||||
if (message.startsWith('/')) {
|
||||
bot.command(message.substring(1))
|
||||
return
|
||||
}
|
||||
bot.chat(message)
|
||||
}
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
const { VM } = require('vm2')
|
||||
const util = require('util')
|
||||
const { stylize } = require('../util/eval_colors')
|
||||
|
||||
const options = {
|
||||
timeout: 1000
|
||||
}
|
||||
let vm = new VM(options)
|
||||
|
||||
module.exports = {
|
||||
name: 'evaljsvm2',
|
||||
trustLevel: 1,
|
||||
description:['old evaljs code'],
|
||||
aliases:['evaljsold', 'evalvm2', 'evalold'],
|
||||
execute (context) {
|
||||
const source = context.source
|
||||
const args = context.arguments
|
||||
const bot = context.bot
|
||||
const ChatMessage = require('prismarine-chat')(bot.options.version)
|
||||
|
||||
const cmd = {
|
||||
translate: '[%s] ',
|
||||
bold: false,
|
||||
color: 'white',
|
||||
with: [
|
||||
{ color: 'dark_green', text: 'EvalJS Cmd'},
|
||||
]
|
||||
}
|
||||
|
||||
// throw new CommandError('temp disabled')
|
||||
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
|
||||
switch (args[1]) {
|
||||
case 'run':
|
||||
try {
|
||||
const output = vm.run(args.slice(2).join(' '))
|
||||
if (!bot.options.Core.enabled){
|
||||
bot.chat(ChatMessage.fromNotch([cmd, { text: util.inspect(output, { stylize }) }]).toMotd().replaceAll('§', '&'))
|
||||
}else
|
||||
source.sendFeedback([cmd, { text: util.inspect(output, { stylize }) }])
|
||||
} catch (e) {
|
||||
if(!bot.options.Core.enabled){
|
||||
bot.chat(ChatMessage.fromNotch([cmd, { text: e.toString(), color: 'black' }]).toMotd().replaceAll('§', '&'))
|
||||
}else{
|
||||
source.sendFeedback([cmd, { text: e.toString(), color: 'black' }])
|
||||
}
|
||||
}
|
||||
break
|
||||
case 'reset':
|
||||
vm = new VM(options)
|
||||
if(!bot.options.Core.enabled){
|
||||
bot.chat(ChatMessage.fromNotch([cmd, { text: 'Successfully reset the eval context', color: 'green' }]).toMotd().replaceAll('§', '&'))
|
||||
}else{
|
||||
source.sendFeedback([cmd, { text: 'Successfully reset the eval context', color: 'green' }])
|
||||
}
|
||||
break
|
||||
default:
|
||||
if(!bot.options.Core.enabled){
|
||||
bot.chat(ChatMessage.fromNotch([cmd, { text: 'Invalid option!', color: 'dark_red' }]).toMotd().replaceAll('§', '&'))
|
||||
}else{
|
||||
source.sendFeedback([cmd, { text: 'Invalid option!', color: 'dark_red' }])
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,279 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'help',
|
||||
aliases:['heko', 'cmd', '?', 'commands', 'cmds' ],
|
||||
description:['shows the command list'],
|
||||
trustLevel: 0,
|
||||
async execute (context) {
|
||||
const bot = context.bot
|
||||
const commandList = []
|
||||
const source = context.source
|
||||
const args = context.arguments
|
||||
// const amogus = bot.prefix
|
||||
const ChatMessage = require('prismarine-chat')(bot.options.version)
|
||||
const cmd = {
|
||||
translate: '[%s] ',
|
||||
bold: false,
|
||||
color: 'white',
|
||||
with: [
|
||||
{ color: 'blue', text: 'Help Cmd'},
|
||||
]
|
||||
}
|
||||
const category = {
|
||||
translate: ' (%s%s%s%s%s) ',
|
||||
bold: false,
|
||||
color: 'white',
|
||||
with: [
|
||||
{ color: '#00FFFF', text: 'Public'},
|
||||
{ color: 'white', text: ' | '},
|
||||
{ color: 'dark_purple', text: 'Trusted'},
|
||||
{ color: 'white', text: ' | '},
|
||||
{ color: 'dark_red', text: 'Owner'},
|
||||
]
|
||||
}
|
||||
|
||||
if (args[0]) {
|
||||
let valid
|
||||
for (const commands in bot.commandManager.commandlist) { // i broke a key woops
|
||||
const command = bot.commandManager.commandlist[commands]
|
||||
|
||||
if (args[0].toLowerCase() === command.name )
|
||||
// if (args[0].toLowerCase() === command.aliases)
|
||||
{//text:`Trust Level: `,color:'white'},
|
||||
//{text:`${command.trustLevel}\n`,color:'red'},
|
||||
function sleep(ms) {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}//bot.getMessageAsPrismarine([cmd, 'Commands (', length, ') ', category, ...pub_lick, t_rust, own_her, cons_ole])?.toAnsi()
|
||||
|
||||
valid = true
|
||||
if(source.sources.console){
|
||||
bot.console.info(bot.getMessageAsPrismarine([cmd, `Description: ${command.description}`])?.toAnsi())
|
||||
|
||||
bot.console.info(bot.getMessageAsPrismarine([cmd, {text:`Trust Level: ${command.trustLevel}`}])?.toAnsi())//[cmd, {text:`Trust Level: ${command.trustLevel}`}]
|
||||
|
||||
bot.console.info(bot.getMessageAsPrismarine([cmd, `aliases: ${command.aliases}`])?.toAnsi())
|
||||
}else if(!bot.options.Core.enabled && !source.sources.console){
|
||||
bot.chat(ChatMessage.fromNotch([cmd, `Description: ${command.description}`]).toMotd().replaceAll('§', '&'))
|
||||
await sleep(1000)
|
||||
bot.chat(ChatMessage.fromNotch([cmd, {text:`Trust Level: ${command.trustLevel}`}]).toMotd().replaceAll('§', '&'))//[cmd, {text:`Trust Level: ${command.trustLevel}`}]
|
||||
await sleep(1000)
|
||||
bot.chat(ChatMessage.fromNotch([cmd, `aliases: ${command.aliases}`]).toMotd().replaceAll('§', '&'))
|
||||
}else{
|
||||
source.sendFeedback([cmd, `Description: ${command.description}`])
|
||||
|
||||
source.sendFeedback([cmd, {text:`Trust Level: ${command.trustLevel}`}])
|
||||
|
||||
source.sendFeedback([cmd, `aliases: ${command.aliases}`])
|
||||
break
|
||||
}
|
||||
} else valid = false
|
||||
}
|
||||
|
||||
//source is defined btw
|
||||
//source.sendFeedback([cmd, 'This command is ' + valid + ' to this for loop'])
|
||||
if (valid) {
|
||||
|
||||
} else {
|
||||
const args = context.arguments
|
||||
|
||||
|
||||
source.sendFeedback([cmd, {translate: `Unknown command %s. Type "${bot.options.commands.prefixes[0]}help" for help or click on this for the command`,color:'red', with: [args[0]], clickEvent: bot.options.Core.customName ? { action: 'suggest_command', value: `${bot.options.commands.prefixes[0]}help` } : undefined}])
|
||||
|
||||
// bot.tellraw([cmd, {translate: `Unknown command %s. Type "${bot.options.commands.prefix}help" for help or click on this for the command`, with: [args[0]], clickEvent: bot.options.Core.customName ? { action: 'suggest_command', value: `${bot.options.commands.prefix}help`, color:'red' } : undefined}])
|
||||
}//i will add the descriptions reading as tests and action add the descriptions for the commands after
|
||||
const length = context.bot.commandManager.commandlist.length // ok
|
||||
//i guess i did delete smh woops
|
||||
|
||||
//context.source.sendFeedback([cmd, 'Commands (', length, ') ', category, ...commandList], false)
|
||||
} else {
|
||||
let pub_lick = []
|
||||
let t_rust = []
|
||||
let own_her = []
|
||||
let cons_ole = []
|
||||
for (const commands in bot.commandManager.commandlist) {
|
||||
const command = bot.commandManager.commandlist[commands]
|
||||
|
||||
// if (command.consoleOnly == true) return console.log(command);
|
||||
if(command.trustLevel === 3) {
|
||||
cons_ole.push(
|
||||
{
|
||||
text: command.name + ' ',
|
||||
color: 'blue',
|
||||
|
||||
|
||||
translate:"",
|
||||
hoverEvent:{
|
||||
action:"show_text",
|
||||
value:[
|
||||
{
|
||||
text:`Command:${command.name}\n`,
|
||||
color:'white'
|
||||
},{
|
||||
text:"HashOnly:",
|
||||
color:'white'},
|
||||
{text:`${command.hashOnly}\n`,color:'red'},
|
||||
{text:'consoleOnly:',color:'white'},
|
||||
{text:`${command.consoleOnly && !context.console}\n`, color:'red'},
|
||||
{text:`${command.description}\n`, color:'white'},
|
||||
{text:`Command Aliases: ${command.aliases}\n`,color:'white'},
|
||||
{text:'click on me to use me :)'},
|
||||
]
|
||||
}
|
||||
}
|
||||
)// copypasted from below, and removed stuff that wont work in the console
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
if (command.trustLevel === 2) {
|
||||
if(!bot.options.Core.enabled && !source.sources.console){
|
||||
own_her.push(`&4${command.name + ' '}`)
|
||||
}else{
|
||||
|
||||
|
||||
own_her.push(
|
||||
{
|
||||
text: command.name + ' ',
|
||||
color: 'dark_red',
|
||||
|
||||
|
||||
translate:"",
|
||||
hoverEvent:{
|
||||
action:"show_text",
|
||||
value:[
|
||||
{
|
||||
text:`Command:${command.name}\n`,
|
||||
color:'white'
|
||||
}, {text:`Trust Level: `,color:'white'},
|
||||
{text:`${command.trustLevel}\n`,color:'dark_red'},
|
||||
{text:`${command.description}\n`, color:'white'},
|
||||
{text:`Command Aliases: ${command.aliases}\n`,color:'white'},
|
||||
{text:'click on me to use me :)'},
|
||||
]
|
||||
},clickEvent:{
|
||||
action:"run_command",value:`${bot.options.commands.prefixes[0]}${command.name}`
|
||||
},
|
||||
// ${command.name}\nhashOnly:§c${command.hashOnly}§r\nconsoleOnly:§c${command.consoleOnly && !context.console}§r\n${command.description}
|
||||
|
||||
///tellraw @a {"translate":"","hoverEvent":{"action":"show_text","value":[{"text":""},{"text":""}]},"clickEvent":{"action":"run_command","value":"a"}}
|
||||
|
||||
}
|
||||
)//my w
|
||||
}
|
||||
}
|
||||
// let valid
|
||||
else if (command.trustLevel === 1){
|
||||
if(!bot.options.Core.enabled && !source.sources.console){
|
||||
t_rust.push(`&5${command.name + ' '}`)
|
||||
}else {
|
||||
t_rust.push(
|
||||
{
|
||||
text: command.name + ' ',
|
||||
color: 'dark_purple',
|
||||
|
||||
|
||||
translate:"",
|
||||
hoverEvent:{
|
||||
action:"show_text",
|
||||
value:[
|
||||
{
|
||||
text:`Command:${command.name}\n`,
|
||||
color:'white'
|
||||
}, {text:`Trust Level: `,color:'white'},
|
||||
{text:`${command.trustLevel}\n`,color:'red'}, {text:`${command.description}\n`, color:'white'},
|
||||
{text:`Command Aliases: ${command.aliases}\n`,color:'white'},
|
||||
{text:'click on me to use me :)'},
|
||||
]
|
||||
},clickEvent:{
|
||||
action:"run_command",value:`${bot.options.commands.prefixes[0]}${command.name}`
|
||||
},
|
||||
// ${command.name}\nhashOnly:§c${command.hashOnly}§r\nconsoleOnly:§c${command.consoleOnly && !context.console}§r\n${command.description}
|
||||
|
||||
///tellraw @a {"translate":"","hoverEvent":{"action":"show_text","value":[{"text":""},{"text":""}]},"clickEvent":{"action":"run_command","value":"a"}}
|
||||
// clickEvent: command.name ? { action: 'suggest_command', value: `~${command.name}` },
|
||||
|
||||
}
|
||||
)
|
||||
}
|
||||
//my w
|
||||
}
|
||||
else if (command.trustLevel === 0){
|
||||
if (!bot.options.Core.enabled && !source.sources.console){
|
||||
pub_lick.push(`&b${command.name + ' '}`)
|
||||
} else{
|
||||
pub_lick.push(
|
||||
{
|
||||
text: command.name + ' ',
|
||||
color: '#00FFFF',
|
||||
translate:"",
|
||||
hoverEvent:{
|
||||
action:"show_text", // Welcome to Kaboom!\n > Free OP - Anarchy - Creative (frfr)
|
||||
value:[
|
||||
{
|
||||
text:`Command:${command.name}\n`,
|
||||
color:'white'
|
||||
},{
|
||||
text:`Trust Level: `,color:'white'},
|
||||
{text:`${command.trustLevel}\n`,color:'red'},
|
||||
{text:`${command.description}\n`, color:'white'},
|
||||
{text:`Command Aliases: ${command.aliases}\n`,color:'white'},
|
||||
{text:'click on me to use me :)'},
|
||||
]
|
||||
},clickEvent:{
|
||||
action:"suggest_command",value:`${bot.options.commands.prefixes[0]}${command.name}`}
|
||||
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
function sleep(ms) {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}
|
||||
|
||||
// Use the sleep function with async/await
|
||||
/*async function main() {
|
||||
console.log("Before sleep");
|
||||
await sleep(1000); // Wait for one second
|
||||
console.log("After sleep");
|
||||
}
|
||||
*/
|
||||
const isConsole = context.source.player ? false : true
|
||||
|
||||
if(source.sources.console) {
|
||||
// mabe idk
|
||||
const length = context.bot.commandManager.commandlist.length
|
||||
|
||||
bot.console.info(bot.getMessageAsPrismarine([cmd, 'Commands (', length, ') ', category, ...pub_lick, t_rust, own_her, cons_ole])?.toAnsi(), false)//[cmd, 'Commands (', length, ') ', category, ...pub_lick, t_rust, own_her, cons_ole]
|
||||
} else if (!bot.options.Core.enabled) {
|
||||
|
||||
const length = context.bot.commandManager.commandlist.filter(c => c.trustLevel != 3).length
|
||||
|
||||
|
||||
bot.chat('Commands (' + length + ') (&bPublic &f| &5Trusted &f| &4Owner&f)')
|
||||
await sleep(1000)
|
||||
bot.chat(`${pub_lick}`)
|
||||
await sleep(1000)
|
||||
bot.chat(`${t_rust}`)
|
||||
await sleep(1000)
|
||||
bot.chat(`${own_her}`)
|
||||
|
||||
|
||||
}else {//+ t_rust + own_her
|
||||
const length = context.bot.commandManager.commandlist.filter(c => c.trustLevel != 3).length
|
||||
//trustlevel
|
||||
source.sendFeedback([cmd, 'Commands (', JSON.stringify(length), ') ', category, ...pub_lick, t_rust ,own_her], false)
|
||||
}
|
||||
// bot.
|
||||
/*
|
||||
bot.tellraw([pub_lick])
|
||||
bot.tellraw([t_rust])
|
||||
bot.tellraw([own_her])
|
||||
*/
|
||||
//console.log(t_rust)
|
||||
}//
|
||||
}
|
||||
}
|
||||
@@ -1,575 +0,0 @@
|
||||
const CommandError = require("../CommandModules/command_error");
|
||||
|
||||
const path = require("path");
|
||||
const fs = require("fs");
|
||||
const packageJSON = require("../package.json");
|
||||
|
||||
module.exports = {
|
||||
name: "info",
|
||||
description: [
|
||||
"check the bots info. the usages are version, discord, serverinfo, logininfo, uptime, creators",
|
||||
],
|
||||
aliases: ["information"],
|
||||
trustLevel: 0,
|
||||
async execute(context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
// const client = context.client
|
||||
const cmd = {
|
||||
//test.js
|
||||
translate: "[%s] ",
|
||||
bold: false,
|
||||
color: "white",
|
||||
with: [{ color: "gold", text: "Info Cmd" }],
|
||||
};
|
||||
function sleep(ms) {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}
|
||||
const buildstring = process.env["buildstring"];
|
||||
const foundationbuildstring = process.env["FoundationBuildString"];
|
||||
const source = context.source;
|
||||
const ChatMessage = require('prismarine-chat')(bot.options.version)
|
||||
switch (args[0]) {
|
||||
case "version":
|
||||
const discordJSVersion = packageJSON.dependencies["discord.js"];
|
||||
const MinecraftProtocolVersion =
|
||||
packageJSON.dependencies["minecraft-protocol"];
|
||||
|
||||
if(!bot.options.Core.enabled){
|
||||
bot.chat(ChatMessage.fromNotch(`${process.env["buildstring"]}`).toMotd().replaceAll('§', '&'))
|
||||
await sleep(1000)
|
||||
|
||||
bot.chat(`${process.env["FoundationBuildString"]}`)
|
||||
await sleep(1000)
|
||||
bot.chat('Bot Release: 11/22/2022')
|
||||
await sleep(1000)
|
||||
bot.chat(`BotEngine: Node-Minecraft-Protocol @${MinecraftProtocolVersion}`)
|
||||
await sleep(1000)
|
||||
bot.chat(`Discord.js ${discordJSVersion}`)
|
||||
await sleep(1000)
|
||||
bot.chat(`Node JS Version ${process.version}`)
|
||||
}else{
|
||||
context.source.sendFeedback({
|
||||
color: "gray",
|
||||
text: `${process.env["buildstring"]}`,
|
||||
});
|
||||
|
||||
context.source.sendFeedback({
|
||||
color: "gray",
|
||||
text: `${process.env["FoundationBuildString"]}`,
|
||||
});
|
||||
|
||||
const date = new Date().toLocaleDateString("en-US", {
|
||||
timeZone: "America/CHICAGO",
|
||||
});
|
||||
|
||||
context.source.sendFeedback({
|
||||
text: `Bot Release: 11/22/2022 `,
|
||||
color: "gray",
|
||||
});
|
||||
|
||||
context.source.sendFeedback({
|
||||
text: `BotEngine:Node-Minecraft-Protocol @${MinecraftProtocolVersion}`,
|
||||
color: "gray",
|
||||
translate: "",
|
||||
hoverEvent: {
|
||||
action: "show_text",
|
||||
value: [
|
||||
{
|
||||
text: "Node-Minecraft-protocol",
|
||||
color: "gray",
|
||||
},
|
||||
],
|
||||
},
|
||||
clickEvent: {
|
||||
action: "open_url",
|
||||
value: `https://github.com/PrismarineJS/node-minecraft-protocol`,
|
||||
},
|
||||
});
|
||||
|
||||
context.source.sendFeedback({
|
||||
text: `Discord.js @${discordJSVersion}`,
|
||||
color: "gray",
|
||||
translate: "",
|
||||
hoverEvent: {
|
||||
action: "show_text",
|
||||
value: [
|
||||
{
|
||||
text: "Discord.js",
|
||||
color: "gray",
|
||||
},
|
||||
],
|
||||
},
|
||||
clickEvent: {
|
||||
action: "open_url",
|
||||
value: `https://github.com/discordjs/discord.js`,
|
||||
},
|
||||
});
|
||||
context.source.sendFeedback({
|
||||
color: "gray",
|
||||
text: `Node js Version @${process.version}`,
|
||||
});
|
||||
}
|
||||
// context.source.sendFeedback({color: 'gray', text:`npm Version:@${npmVersion}`})
|
||||
|
||||
break;
|
||||
case "thankyou":
|
||||
var prefix =
|
||||
"&8&l&m[&4&mParker2991&8]&8&m[&b&mBOYFRIEND&8]&8&m[&b&mCONSOLE&8]&r ";
|
||||
bot.core.run(
|
||||
"bcraw " +
|
||||
prefix +
|
||||
"Thank you for all that helped and contributed with the bot, it has been one hell of a ride with the bot hasnt it? From November 22, 2022 to now, 0.1 beta to 4.0 alpha, Mineflayer to Node-Minecraft-Protocol. I have enjoyed all the new people i have met throughout the development of the bot back to the days when the bot used mineflayer for most of its lifespan to the present as it now uses node-minecraft-protocol. Its about time for me to tell how development went in the bot well here it is, back in 0.1 beta of the bot it was skidded off of menbot 1.0 reason why? Well because LoginTimedout gave me the bot when ayunboom was still a thing and he helped throughout that time period bot and when 1.0 beta came around he he just stopped helping me on it why? because he had servers to run so yeah but anyway back then i didnt know what skidded like i do now so i thought i could get away with but i was wrong 💀. Early names considered for the bot were &6&lParkerBot &4&lDEMONBot &b&lWoomyBot &b&lBoyfriendBot,&r i kept the name &b&lBoyfriendBot&r throughout most of the early development but i got sick and tired of being harassed about the name being told it was gay but people really didnt know what it meant did they? It was referenced to Boyfriend from Friday Night Funkin’ so right around 1.0 released i renamed it to &b&lFNFBoyfriend&4&lBot &rand around 2.0 changed it to &5&lFNF&b&lBoyfriend&4&lBot &rand luckily avoided the harassment when i changed it i love coding and i want to learn how to code more thank you all!",
|
||||
);
|
||||
break;
|
||||
case "discord":
|
||||
if(!bot.options.Core.enabled){
|
||||
bot.chat(`${bot.options.discord.invite}`)
|
||||
}else {
|
||||
source.sendFeedback({
|
||||
text: bot.options.discord.invite,
|
||||
color: "gray",
|
||||
translate: "",
|
||||
hoverEvent: {
|
||||
action: "show_text",
|
||||
value: [
|
||||
{
|
||||
text: "click here to join!",
|
||||
color: "gray",
|
||||
},
|
||||
],
|
||||
},
|
||||
clickEvent: {
|
||||
action: "open_url",
|
||||
value: `${bot.options.discord.invite}`,
|
||||
},
|
||||
});
|
||||
}
|
||||
break;
|
||||
case "serverinfo":
|
||||
const os = require("os");
|
||||
if(!bot.options.Core.enabled){
|
||||
bot.chat(`Hostname: ${os.hostname()}`)
|
||||
await sleep(1000)
|
||||
bot.chat(`Working Directory: ${path.join(__dirname, "..")}`)
|
||||
await sleep(1000)
|
||||
bot.chat(`OS architecture: ${os.arch()}`)
|
||||
await sleep(1000)
|
||||
bot.chat(`OS platform: ${os.platform()}`)
|
||||
await sleep(1000)
|
||||
bot.chat(`OS name ${os.version()}`)
|
||||
await sleep(1000)
|
||||
bot.chat(`Kernal Version: ${os.release()}`)
|
||||
await sleep(1000)
|
||||
bot.chat(`CPU cores ${os.cpus().length}`)
|
||||
await sleep(1000)
|
||||
bot.chat(`CPU Model: ${os.cpus()[0].model}`)
|
||||
await sleep(1000)
|
||||
bot.chat(`Server Free memory ${Math.floor(
|
||||
os.freemem() / 1048576)} MiB / ${Math.floor(os.totalmem() / 1048576)} MiB`)
|
||||
}else {
|
||||
|
||||
|
||||
context.source.sendFeedback({
|
||||
color: "gray",
|
||||
text: `Hostname: ${os.hostname()}`,
|
||||
});
|
||||
context.source.sendFeedback({
|
||||
color: "gray",
|
||||
text: `Working Directory: ${path.join(__dirname, "..")}`,
|
||||
});
|
||||
context.source.sendFeedback({
|
||||
color: "gray",
|
||||
text: `OS architecture: ${os.arch()}`,
|
||||
});
|
||||
context.source.sendFeedback({
|
||||
color: "gray",
|
||||
text: `OS platform: ${os.platform()}`,
|
||||
});
|
||||
context.source.sendFeedback({
|
||||
color: "gray",
|
||||
text: `OS name: ${os.version()}`,
|
||||
});
|
||||
context.source.sendFeedback({
|
||||
color: "gray",
|
||||
text: `Kernal Version: ${os.release()}`,
|
||||
});
|
||||
context.source.sendFeedback({
|
||||
color: "gray",
|
||||
text: `CPU cores: ${os.cpus().length}`,
|
||||
});
|
||||
|
||||
/*
|
||||
if (os.platform() !== 'linux'){
|
||||
source.sendFeedback({text:'cannot find the cpu model are you sure the bot is running on linux?', color:'red'})
|
||||
}
|
||||
else if (os.platform() === 'linux') {
|
||||
*/ source.sendFeedback({
|
||||
color: "gray",
|
||||
text: `CPU model: ${os.cpus()[0].model}`,
|
||||
});
|
||||
source.sendFeedback({
|
||||
translate:'%s%s%s',
|
||||
color: "gray",
|
||||
with: [{text:`Server Free memory `, color:'gray'},{text:`${Math.floor(
|
||||
os.freemem() / 1048576,
|
||||
)} `,color:'gray'},{text: `MiB / ${Math.floor(os.totalmem() / 1048576)} MiB`, color:'gray'}],
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
`Server Memory Usage `, color:'gray'},{text:`${Math.floor(
|
||||
os.freemem() / 1048576,
|
||||
)} `,color:'gray'},{text: `MiB / ${Math.floor(os.totalmem() / 1048576)} MiB
|
||||
*/
|
||||
break;
|
||||
case "logininfo":
|
||||
if (!bot.options.Core.enabled){
|
||||
bot.chat(`Bot Username: ${bot.username}`)
|
||||
await sleep(1000)
|
||||
bot.chat(`Bot uuid "${bot.uuid}"`)
|
||||
await sleep(1000)
|
||||
bot.chat(`Minecraft Java Version: ${bot.version}`)
|
||||
await sleep(1000)
|
||||
bot.chat(`Server: "${bot.options.host}:${bot.options.port}"`)
|
||||
await sleep(1000)
|
||||
bot.chat(`Prefixes: ${bot.options.commands.prefixes.join(', ')}`)
|
||||
await sleep(1000)
|
||||
bot.chat(`Discord Prefix: "${bot.options.discord.commandPrefix}"`)
|
||||
await sleep(1000)
|
||||
bot.chat(`Discord Username: "${bot.discord.client.user.username}#${bot.discord.client.user.discriminator}"`)
|
||||
await sleep(1000)
|
||||
bot.chat(`Discord Channel: ${bot.discord.channel.name}`)
|
||||
await sleep(1000)
|
||||
bot.chat(`ConsoleServer:"${bot.console.consoleServer}"`)
|
||||
await sleep(1000)
|
||||
const amonger2 = bot.bots.map((eachBot) => eachBot.options.host + "\n");
|
||||
const port2 = bot.bots.map((eachBot) => eachBot.options.port);
|
||||
|
||||
if (amonger2.length === 0) {
|
||||
const list = [];
|
||||
for (const host of bots) {
|
||||
if (list.length !== 0) {
|
||||
list.push(host.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
bot.chat(`Servers in Config ${amonger2.length}`);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
const amonger = bot.bots.map((eachBot) => eachBot.options.host + "\n");
|
||||
const port = bot.bots.map((eachBot) => eachBot.options.port);
|
||||
|
||||
if (amonger.length === 0) {
|
||||
const list = [];
|
||||
for (const host of bots) {
|
||||
if (list.length !== 0) {
|
||||
list.push(host.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
source.sendFeedback({ text: `Servers in Config ${amonger.length}` });
|
||||
|
||||
*/
|
||||
}else{
|
||||
source.sendFeedback({
|
||||
text: `Bot Username: "${bot.username}"`,
|
||||
color: "gray",
|
||||
});
|
||||
source.sendFeedback({ text: `Bot uuid:"${bot.uuid}"`, color: "gray" });
|
||||
|
||||
source.sendFeedback({
|
||||
text: `Minecraft Java Version: "${bot.version}"`,
|
||||
color: "gray",
|
||||
});
|
||||
|
||||
source.sendFeedback({
|
||||
text: `Server: "${bot.options.host}:${bot.options.port}"`,
|
||||
color: "gray",
|
||||
});
|
||||
|
||||
source.sendFeedback({
|
||||
text: `Prefixes: ${bot.options.commands.prefixes.join(', ')}`,
|
||||
color: "gray",
|
||||
});
|
||||
|
||||
source.sendFeedback({
|
||||
text: `Discord Prefix: "${bot.options.discord.commandPrefix}"`,
|
||||
color: "gray",
|
||||
});
|
||||
|
||||
source.sendFeedback({
|
||||
text: `Discord Username: "${bot.discord.client.user.username}#${bot.discord.client.user.discriminator}"`,
|
||||
color: "gray",
|
||||
});
|
||||
|
||||
source.sendFeedback({
|
||||
text: `Discord Channel: ${bot.discord.channel.name}`,
|
||||
});
|
||||
source.sendFeedback({
|
||||
color: "gray",
|
||||
text: `ConsoleServer:"${bot.console.consoleServer}"`,
|
||||
});
|
||||
|
||||
const amonger = bot.bots.map((eachBot) => eachBot.options.host + "\n");
|
||||
const port = bot.bots.map((eachBot) => eachBot.options.port);
|
||||
|
||||
if (amonger.length === 0) {
|
||||
const list = [];
|
||||
for (const host of bots) {
|
||||
if (list.length !== 0) {
|
||||
list.push(host.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
source.sendFeedback({ text: `Servers in Config ${amonger.length}` });
|
||||
|
||||
}
|
||||
break;
|
||||
case "loaded":
|
||||
|
||||
const util = "./util";
|
||||
const modules = "./modules";
|
||||
const commands = "./commands";
|
||||
const CommandModules = "./CommandModules";
|
||||
|
||||
const chat = "./chat";
|
||||
if (!bot.options.Core.enabled){
|
||||
fs.readdir(util, (err, files) => {
|
||||
bot.chat(`Util files loaded: ${files.length}`);
|
||||
});
|
||||
await sleep(1000)
|
||||
fs.readdir(modules, (err, files) => {
|
||||
bot.chat(`Modules files loaded: ${files.length}`);
|
||||
});
|
||||
await sleep(1000)
|
||||
fs.readdir(commands, (err, files) => {
|
||||
bot.chat(`Command files loaded: ${files.length}`);
|
||||
});
|
||||
await sleep(1000)
|
||||
fs.readdir(CommandModules, (err, files) => {
|
||||
bot.chat(`Command Module files loaded: ${files.length}`);
|
||||
});
|
||||
await sleep(1000)
|
||||
fs.readdir(chat, (err, files) => {
|
||||
bot.chat(`Chat files loaded: ${files.length}`);
|
||||
});
|
||||
}else {
|
||||
fs.readdir(util, (err, files) => {
|
||||
source.sendFeedback({text:`Util files loaded: ${files.length}`});
|
||||
});
|
||||
|
||||
fs.readdir(modules, (err, files) => {
|
||||
source.sendFeedback({text:`Modules files loaded: ${files.length}`});
|
||||
});
|
||||
|
||||
fs.readdir(commands, (err, files) => {
|
||||
source.sendFeedback({text:`Command files loaded: ${files.length}`});
|
||||
});
|
||||
|
||||
fs.readdir(CommandModules, (err, files) => {
|
||||
source.sendFeedback({text:`Command Module files loaded: ${files.length}`});
|
||||
});
|
||||
|
||||
fs.readdir(chat, (err, files) => {
|
||||
source.sendFeedback({text:`Chat files loaded: ${files.length}`});
|
||||
});
|
||||
}
|
||||
break;
|
||||
case "test":
|
||||
// bot.tellraw('test')
|
||||
// const porta = bot.bots.map(eachBot => eachBot.options.port)
|
||||
const amongerus = bot.bots.map(
|
||||
(eachBot) => eachBot.options.host + ":" + eachBot.options.port + "\n",
|
||||
);
|
||||
/*
|
||||
if (amonger.length === 0){
|
||||
const list = [];
|
||||
for (const host of bots){
|
||||
if (list.length !== 0) {
|
||||
list.push({text:`Server Count: ${host.name}`})
|
||||
}
|
||||
}
|
||||
|
||||
} */
|
||||
//source.sendFeedback()
|
||||
source.sendFeedback(amongerus);
|
||||
// source.sendFeedback(amonger)
|
||||
break;
|
||||
case "uptime":
|
||||
function format(seconds) {
|
||||
function pad(s) {
|
||||
return (s < 10 ? "0" : "") + s;
|
||||
}
|
||||
var hours = Math.floor(seconds / (60 * 60));
|
||||
var minutes = Math.floor((seconds % (60 * 60)) / 60);
|
||||
var seconds = Math.floor(seconds % 60);
|
||||
|
||||
return (
|
||||
pad(`${hours} Hours`) +
|
||||
" " +
|
||||
pad(`${minutes} Minutes`) +
|
||||
" " +
|
||||
pad(`${seconds} Seconds`)
|
||||
);
|
||||
}
|
||||
|
||||
var uptime = process.uptime();
|
||||
if(!bot.options.Core.enabled){
|
||||
bot.chat(`Bot Uptime: ${format(uptime)}`)
|
||||
} else {
|
||||
|
||||
source.sendFeedback({
|
||||
color: "gray",
|
||||
text: `Bot Uptime: ${format(uptime)}`,
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
||||
case "creators":
|
||||
if(!bot.options.Core.enabled){
|
||||
bot.chat('Thank you all that helped!')
|
||||
await sleep(1000)
|
||||
bot.chat(`&4Parker&02991`)
|
||||
await sleep(1000)
|
||||
bot.chat('&2_ChipMC_')
|
||||
await sleep(1000)
|
||||
bot.chat('&echayapak')
|
||||
await sleep(1000)
|
||||
bot.chat('&d_yfd')
|
||||
await sleep(1000)
|
||||
bot.chat('&6Poopcorn (Poopbob???)')
|
||||
}else{
|
||||
source.sendFeedback({
|
||||
color: "gray",
|
||||
text: "Thank you to all that helped!",
|
||||
});
|
||||
source.sendFeedback({
|
||||
translate: "%s%s",
|
||||
with: [
|
||||
{ color: "dark_red", text: "Parker" },
|
||||
{ color: "black", text: "2991" },
|
||||
],
|
||||
|
||||
hoverEvent: {
|
||||
action: "show_text",
|
||||
value: [
|
||||
{
|
||||
text: "FNF",
|
||||
color: "dark_purple",
|
||||
bold: true,
|
||||
},
|
||||
{
|
||||
text: "Boyfriend",
|
||||
color: "aqua",
|
||||
bold: true,
|
||||
},
|
||||
{
|
||||
text: "Bot ",
|
||||
color: "dark_red",
|
||||
bold: true,
|
||||
},
|
||||
{
|
||||
text: "Discord",
|
||||
color: "blue",
|
||||
bold: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
clickEvent: {
|
||||
action: "open_url",
|
||||
value: `${bot.options.discord.invite}`,
|
||||
},
|
||||
});
|
||||
source.sendFeedback({
|
||||
text: "_ChipMC_",
|
||||
color: "dark_green",
|
||||
translate: "",
|
||||
hoverEvent: {
|
||||
action: "show_text",
|
||||
value: [
|
||||
{
|
||||
text: "chipmunk dot land",
|
||||
color: "green",
|
||||
},
|
||||
],
|
||||
},
|
||||
clickEvent: {
|
||||
action: "open_url",
|
||||
value: `https://chipmunk.land`,
|
||||
},
|
||||
});
|
||||
source.sendFeedback({
|
||||
text: "chayapak",
|
||||
color: "yellow",
|
||||
translate: "",
|
||||
hoverEvent: {
|
||||
action: "show_text",
|
||||
value: [
|
||||
{
|
||||
text: "Chomens ",
|
||||
color: "yellow",
|
||||
},
|
||||
{
|
||||
text: "Discord",
|
||||
color: "blue",
|
||||
},
|
||||
],
|
||||
},
|
||||
clickEvent: {
|
||||
action: "open_url",
|
||||
value: `https://discord.gg/xdgCkUyaA4`,
|
||||
},
|
||||
});
|
||||
source.sendFeedback({
|
||||
text: "_yfd",
|
||||
color: "light_purple",
|
||||
translate: "",
|
||||
hoverEvent: {
|
||||
action: "show_text",
|
||||
value: [
|
||||
{
|
||||
text: "ABot ",
|
||||
color: "gold",
|
||||
bold: true,
|
||||
},
|
||||
{
|
||||
text: "Discord",
|
||||
color: "blue",
|
||||
bold: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
clickEvent: {
|
||||
action: "open_url",
|
||||
value: `https://discord.gg/CRfP2ZbG8T`,
|
||||
},
|
||||
});
|
||||
source.sendFeedback({ text: "Poopcorn(Poopbob???)", color: "gold" });
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
if (!bot.options.Core.enabled){
|
||||
bot.chat('&4Invalid action')
|
||||
await sleep(500)
|
||||
bot.chat('the usages are version, discord, serverinfo, logininfo, uptime, creators')
|
||||
}else{
|
||||
context.source.sendError([
|
||||
cmd,
|
||||
{ text: "Invalid action", color: "dark_red", bold: false },
|
||||
]);
|
||||
context.source.sendError([
|
||||
cmd,
|
||||
{
|
||||
text: "the usages are version, discord, serverinfo, logininfo, uptime, creators",
|
||||
color: "gray",
|
||||
bold: false,
|
||||
},
|
||||
]);
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
@@ -1,42 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
let timer = null
|
||||
|
||||
module.exports = {
|
||||
name: 'kick',
|
||||
|
||||
description:['kicks a player'],
|
||||
|
||||
trustLevel: 1,
|
||||
aliases:[],
|
||||
execute(context) {
|
||||
// throw new CommandError('temp disabled')
|
||||
//throw new CommandError('command temporarily disabled until hashing is implemented')
|
||||
const args = context.arguments
|
||||
if (!args && !args[0] && !args[1]) return
|
||||
if (args[2] === 'clear' || args[2] === 'stop') {
|
||||
clearInterval(this.timer)
|
||||
this.timer = null
|
||||
|
||||
context.source.sendFeedback('Cloop Stopped', false)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
// if (this.timer !== null) throw new CommandError('The bot can currently only loop one command')
|
||||
// anti fard
|
||||
|
||||
const target = context.player//let me hashonly it rq
|
||||
this.timer = setInterval(function() { // Wait, is this command public?
|
||||
repeat(context.bot, 400, `tellraw ${args[1]} {"text":"${'ඞ'.repeat(20000)}","bold":true,"italic":true,"obfuscated":true,"color":"#FF0000"}`)
|
||||
|
||||
}, 10)
|
||||
}
|
||||
}//i found that there is a limit
|
||||
|
||||
// Repeat the command over and over.
|
||||
function repeat(bot, repetitions, cmd) {
|
||||
for (let i = 0; i < repetitions; i++) {
|
||||
bot.core.run(cmd)
|
||||
}
|
||||
}
|
||||
@@ -1,88 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'list',
|
||||
description:['check the player list'],
|
||||
trustLevel: 0,
|
||||
aliases:['playerlist', 'plist', 'pl'],
|
||||
async execute (context) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
const players = bot.players
|
||||
const source = context.source
|
||||
const component = []
|
||||
// if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
|
||||
if (args.length !== 0){
|
||||
throw new CommandError({translate:"Too many Arguments!", color:"red"})
|
||||
}
|
||||
/*
|
||||
if (amonger2.length === 0) {
|
||||
const list = [];
|
||||
for (const host of bots) {
|
||||
if (list.length !== 0) {
|
||||
list.push(host.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
for (const player of players) {
|
||||
component.push({
|
||||
translate: `%s \u203a %s [%s] %s`,
|
||||
with: [
|
||||
|
||||
player.displayName ?? player.profile.name,
|
||||
player.uuid,
|
||||
{text: `Ping: ${player.latency}`, color:'green'},
|
||||
player.gamemode
|
||||
]
|
||||
})
|
||||
|
||||
component.push('\n')
|
||||
}
|
||||
|
||||
component.pop()
|
||||
function sleep(ms) {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}
|
||||
/*
|
||||
for (const player of players) {
|
||||
component.push({
|
||||
translate: '%s \u203a %s [%s] %s',
|
||||
with: [
|
||||
|
||||
player.displayName ?? player.profile.name,
|
||||
player.uuid,
|
||||
{text: `Ping: ${player.latency}`, color:'green'},
|
||||
player.gamemode
|
||||
]
|
||||
})
|
||||
|
||||
component.push('\n')
|
||||
}
|
||||
*/
|
||||
if(source.sources.console){
|
||||
|
||||
bot.console.info(bot.getMessageAsPrismarine(component)?.toAnsi())
|
||||
|
||||
}else
|
||||
if(!bot.options.Core.enabled){
|
||||
|
||||
const ChatMessage = require('prismarine-chat')(bot.options.version)
|
||||
for (const player of players){
|
||||
|
||||
bot.chat(ChatMessage.fromNotch(await sleep(500) ?? player.displayName ?? player.profile.name ).toMotd().replaceAll('§', '&') + `\u203a ${player.uuid} Ping: [&a${player.latency}&f]`)
|
||||
}
|
||||
}else{
|
||||
|
||||
//const players = bot.players
|
||||
|
||||
source.sendFeedback({text:`Players: (${JSON.stringify(bot.players.length)})`})
|
||||
source.sendFeedback(component, false)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
//what is wi
|
||||
// IDK
|
||||
@@ -1,159 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error.js')
|
||||
module.exports = {
|
||||
name: 'netmsg',
|
||||
description:['send a message to other servers'],
|
||||
trustLevel: 0,
|
||||
aliases:['networkmessage', 'netmessage', 'networkmsg'],
|
||||
execute (context) {
|
||||
|
||||
const message = context.arguments.join(' ')
|
||||
|
||||
|
||||
const args = context.arguments
|
||||
const bot = context.bot
|
||||
const ChatMessage = require('prismarine-chat')(bot.options.version)
|
||||
const source = context.source
|
||||
|
||||
if (!message[0]) {
|
||||
|
||||
context.source.sendFeedback({text:'Message is empty', color:'red'}, false)
|
||||
if(source.sources.console && !bot.options.Core.enabled){
|
||||
|
||||
for (const eachBot of bot.bots)
|
||||
|
||||
eachBot.chat(`[${bot.options.host}:${bot.options.port}] ${ChatMessage.fromNotch(bot.options.username).toMotd().replaceAll('§', '&')} &f› ${message}`)
|
||||
}
|
||||
} else if (!bot.options.Core.enabled && !source.sources.console) {
|
||||
|
||||
|
||||
for (const eachBot of bot.bots)
|
||||
|
||||
eachBot.chat(`[${bot.options.host}:${bot.options.port}] ${ChatMessage.fromNotch(context.source.player.displayName ?? context.source.player.profile.name).toMotd().replaceAll('§', '&')} &f› ${message}`)//
|
||||
}else if(source.sources.console){
|
||||
const component = {
|
||||
translate: '[%s] [%s] %s \u203a %s',
|
||||
with: [
|
||||
{
|
||||
translate: '%s%s%s',
|
||||
bold:false,
|
||||
with: [
|
||||
{
|
||||
text: 'FNF',
|
||||
bold: true,
|
||||
color: 'dark_purple'
|
||||
|
||||
},
|
||||
{
|
||||
text: 'Boyfriend',
|
||||
bold: true,
|
||||
color: '#00FFFF'
|
||||
},
|
||||
{
|
||||
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:`${bot.options.host}:${bot.options.port}`,
|
||||
bold:false,
|
||||
color:'white',
|
||||
translate:"",
|
||||
hoverEvent:{
|
||||
action:"show_text",
|
||||
value:[
|
||||
{
|
||||
text:`Server: ${bot.options.host}:${bot.options.port}`,
|
||||
color:'white',
|
||||
}
|
||||
],
|
||||
clickEvent:{
|
||||
action:"copy_to_clipboard",value:`${bot.options.host}:${bot.options.port}`}
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
|
||||
|
||||
bot.username,
|
||||
|
||||
//entry.displayName
|
||||
{text:bot.getMessageAsPrismarine(message).toMotd.replaceAll('&','\xa7')}
|
||||
]//command.split(' ')[0]
|
||||
}
|
||||
|
||||
|
||||
for (const eachBot of bot.bots)
|
||||
eachBot.tellraw(component)
|
||||
|
||||
}else if(bot.options.Core.enabled && !source.sources.console){
|
||||
|
||||
const component = {
|
||||
translate: '[%s] [%s] %s \u203a %s',
|
||||
with: [
|
||||
{
|
||||
translate: '%s%s%s',
|
||||
bold:false,
|
||||
with: [
|
||||
{
|
||||
text: 'FNF',
|
||||
bold: true,
|
||||
color: 'dark_purple'
|
||||
|
||||
},
|
||||
{
|
||||
text: 'Boyfriend',
|
||||
bold: true,
|
||||
color: '#00FFFF'
|
||||
},
|
||||
{
|
||||
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:`${bot.options.host}:${bot.options.port}`,
|
||||
bold:false,
|
||||
color:'white',
|
||||
translate:"",
|
||||
hoverEvent:{
|
||||
action:"show_text",
|
||||
value:[
|
||||
{
|
||||
text:`Server: ${bot.options.host}:${bot.options.port}`,
|
||||
color:'white',
|
||||
}
|
||||
],
|
||||
clickEvent:{
|
||||
action:"copy_to_clipboard",value:`${bot.options.host}:${bot.options.port}`}
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
|
||||
|
||||
context?.source?.player?.displayName ?? context?.source?.player?.profile?.name,
|
||||
|
||||
|
||||
{text:bot.getMessageAsPrismarine(message).toMotd().replaceAll('&', '\xa7')}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
for (const eachBot of bot.bots)
|
||||
eachBot.tellraw(component)
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
const CommandError = require("../CommandModules/command_error");
|
||||
const buildstring = process.env["buildstring"];
|
||||
const foundation = process.env["FoundationBuildString"];
|
||||
module.exports = {
|
||||
name: "say",
|
||||
//<< this one line of code broke it lmao
|
||||
description: ["make me say something in custom chat"],
|
||||
trustLevel: 0,
|
||||
aliases: [
|
||||
"tellrawsay",
|
||||
"tellrawmsg",
|
||||
"trmessage",
|
||||
"tellrawmessage",
|
||||
"sourcesendfeedbacksay",
|
||||
"sourcesendfeedbackmsg",
|
||||
"sourcesendfeedbackmessage",
|
||||
"ssfbmsg",
|
||||
"ssfmessage",
|
||||
],
|
||||
execute(context) {
|
||||
const message = context.arguments.join(" ");
|
||||
const bot = context.bot;
|
||||
|
||||
const prefix = {
|
||||
translate: "[%s%s%s] \u203a %s",
|
||||
bold: false,
|
||||
color: "white",
|
||||
with: [
|
||||
{
|
||||
color: "dark_purple",
|
||||
text: "FNF",
|
||||
bold: true,
|
||||
},
|
||||
{
|
||||
color: "#00FFFF",
|
||||
text: "Boyfriend",
|
||||
bold: true,
|
||||
},
|
||||
{ color: "dark_red", text: "Bot", bold: true },
|
||||
|
||||
{ color: "green", text: `${message}` },
|
||||
],
|
||||
};
|
||||
//if(!bot.options.Core.enabled){
|
||||
// throw new CommandError('&4Will not work because the core is not enabled please use the echo command')
|
||||
//}else{
|
||||
bot.tellraw([prefix]);
|
||||
}
|
||||
// },
|
||||
};
|
||||
|
||||
//[%s] %s › %s
|
||||
//was it showing like that before?
|
||||
// just do text bc too sus rn ig
|
||||
// You should remove the with thing and the translate and replace
|
||||
|
||||
// Parker, why is hashing just random characters???
|
||||
//wdym
|
||||
@@ -1,55 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'servereval',
|
||||
description:['no'],
|
||||
trustLevel: 2,
|
||||
aliases:['svreval'],
|
||||
async execute (context, arguments, selector) {
|
||||
const bot = context.bot
|
||||
// const args = context.arguments.join(' ')
|
||||
const source = context.source
|
||||
// throw new CommandError('temp disabled')
|
||||
const { stylize } = require('../util/eval_colors')
|
||||
const util = require('util')
|
||||
const args = context.arguments
|
||||
const ChatMessage = require('prismarine-chat')(bot.options.version)
|
||||
const script = args.slice(1).join(' ');
|
||||
//bot.chat(ChatMessage.fromNotch(message).toMotd().replaceAll('\xa7', '&'))
|
||||
if (!args && !args[0] && !args[1] && !args[2] && !args[3] && !args[4] ) return
|
||||
function sleep(ms) {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}//ChatMessage.fromNotch(await sleep(500) ).toMotd().replaceAll('§', '&')`
|
||||
try {
|
||||
if(source.sources.console){
|
||||
bot.console.info({ text: util.inspect(eval(args.slice(0).join(' ')), { stylize }).substring(0, 32700) })
|
||||
bot.console.info({ text: `Script input: ${script}` })
|
||||
} else
|
||||
if(!bot.options.Core.enabled && !source.sources.console){
|
||||
|
||||
bot.chat(ChatMessage.fromNotch(await sleep(500) ?? { text: util.inspect(eval( args.slice(1).join(' ')), { stylize }).substring(0, 32700) }).toMotd().replaceAll('§', '&'))
|
||||
}else {
|
||||
|
||||
//{ text: util.inspect(eval(script), { stylize }).substring(0, 32700) }
|
||||
source.sendFeedback({ text: util.inspect(eval(script), { stylize }).substring(0, 32700) })
|
||||
source.sendFeedback({ text: `Script input: ${script}` })
|
||||
}
|
||||
} catch (err) {
|
||||
if(!bot.options.Core.enabled && !source.sources.console){
|
||||
bot.chat(`&4${err.message}`)
|
||||
}else if(source.sources.console){
|
||||
bot.console.warn({ text: err.message, color: 'red' })
|
||||
} else {
|
||||
source.sendFeedback({ text: err.message, color: 'red' })
|
||||
source.sendFeedback({ text: `Script input: ${script}` })
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* try {
|
||||
bot.tellraw({ text: util.inspect(eval(context.arguments.slice().join(' ')), { stylize }).substring(0, 32700) })
|
||||
} catch (err) {
|
||||
bot.tellraw({ text: util.inspect(err).replaceAll('runner', 'runner'), color: 'red' })
|
||||
}
|
||||
*/
|
||||
@@ -1,18 +0,0 @@
|
||||
const { translate } = require('@vitalets/google-translate-api')
|
||||
module.exports = {
|
||||
name:'translate',
|
||||
description:['<language 1> <language 2> <message>'],
|
||||
aliases:['translation'],
|
||||
trustLevel: 0,
|
||||
async execute (context) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
|
||||
try {
|
||||
const res = await translate(args.slice(2).join(' '), { from: args[0], to: args[1] })
|
||||
bot.tellraw( [{ text: 'Result: ', color: 'gold' }, { text: res.text, color: 'green' }])
|
||||
} catch (e) {
|
||||
bot.tellraw( { text: String(e), color: 'red' })
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,97 +0,0 @@
|
||||
const urban = require('urban-dictionary')
|
||||
|
||||
module.exports = {
|
||||
name: 'urban',
|
||||
description:['urban dictionary'],
|
||||
aliases:['urbandictionary'],
|
||||
trustLevel: 0,
|
||||
async execute (context) {
|
||||
const source = context.source
|
||||
const args = context.arguments
|
||||
const bot = context.bot
|
||||
const cmd = {
|
||||
translate: '[%s] ',
|
||||
bold: false,
|
||||
color: 'white',
|
||||
with: [
|
||||
{ color: 'dark_red', text: 'Urban Cmd'},
|
||||
]
|
||||
}
|
||||
const example = {
|
||||
translate: '%s - ',
|
||||
bold: false,
|
||||
color: 'white',
|
||||
with: [
|
||||
{ color: 'dark_gray', text: 'Example text'},
|
||||
]
|
||||
}
|
||||
const definition5 = {
|
||||
translate: '%s - ',
|
||||
bold: false,
|
||||
color: 'white',
|
||||
with: [
|
||||
{ color: 'dark_gray', text: 'Definition text'},
|
||||
]
|
||||
}
|
||||
async function sleep(ms) {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}
|
||||
try {
|
||||
const definitions = await urban.define(args.join(' '))
|
||||
const definitions2 = await urban.define(args.join(' '))
|
||||
//const definitions2 = await urban.example(args.join(' '))
|
||||
//ChatMessage.fromNotch(await sleep(500) ?? player.displayName ?? player.profile.name ).toMotd().replaceAll('§', '&')
|
||||
if(!bot.options.Core.enabled){
|
||||
const ChatMessage = require('prismarine-chat')(bot.options.version)
|
||||
for (const definition of definitions) {
|
||||
|
||||
|
||||
bot.chat(ChatMessage.fromNotch(await sleep(2300)
|
||||
?? [cmd, example, { text: definition.example.replaceAll("\r", ""), color: 'gray' }, { text: ' - ', color: 'white' }]).toMotd().replaceAll('§', '&'))
|
||||
await sleep(500)
|
||||
bot.chat(ChatMessage.fromNotch(await sleep(2300) ?? [cmd, definition5,{ text: definition.definition.replaceAll("\r", ""), color: 'gray' } ]).toMotd().replaceAll('§', '&'))
|
||||
}//oh
|
||||
}else{//??
|
||||
|
||||
for (const definition of definitions) {
|
||||
|
||||
source.sendFeedback([cmd, example, { text: definition.example.replaceAll("\r", ""), color: 'gray' }, { text: ' - ', color: 'white' }])
|
||||
source.sendFeedback([cmd, definition5,{ text: definition.definition.replaceAll("\r", ""), color: 'gray' } ])
|
||||
}
|
||||
|
||||
|
||||
|
||||
urban.define(args.join(' ')).then((results) => {
|
||||
source.sendFeedback([cmd,{text:`Definition: ${results[0].word}`, color:'dark_gray'}])
|
||||
source.sendFeedback([cmd,{text:`Author: ${results[0].author}`, color:'dark_gray'}])
|
||||
//source.sendFeedback(results[0].thumbs_down)
|
||||
source.sendFeedback([cmd,{text:`👍 ${results[0].thumbs_up} | 👎 ${results[0].thumbs_down}`, color:'gray'}])
|
||||
|
||||
|
||||
//source.sendFeedback(results[0].written_on)
|
||||
|
||||
//thumbs_down
|
||||
|
||||
|
||||
//source.sendFeedback(results[0].data)
|
||||
}).catch((error) => {
|
||||
console.error(error.message)
|
||||
})
|
||||
//source.sendFeedback(results[0].data)
|
||||
}
|
||||
// source.sendFeedback([cmd, { text: definitions2.replaceAll("\r", ""), color: 'white' }, { text: ' - ', color: 'white' }, { text: definition.definition.replaceAll("\r", ""), color: 'white' }])
|
||||
//console.log(urban.define.definition.example(args.join(' ')))
|
||||
|
||||
|
||||
//text: definition.word text: definition.definition
|
||||
|
||||
} catch (e) {
|
||||
if (!bot.options.Core.enabled){
|
||||
const ChatMessage = require('prismarine-chat')(bot.options.version)
|
||||
bot.chat(ChatMessage.fromNotch([cmd,{ text: e.toString(), color: 'red' }]).toMotd().replaceAll('§', '&'))
|
||||
}else {
|
||||
source.sendFeedback([cmd,{ text: e.toString(), color: 'red' }])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
module.exports = {
|
||||
name: 'validate',
|
||||
description:['validate in the bot'],
|
||||
|
||||
trustLevel: 1,
|
||||
aliases:['val'],
|
||||
execute (context) {
|
||||
const source = context.source
|
||||
const bot = context.bot
|
||||
const hash = bot.hash
|
||||
const args = context.arguments
|
||||
const ownerhash = bot.owner
|
||||
const discordHash = bot.hashing.hash
|
||||
if (args[0] === hash) {
|
||||
if(!bot.options.Core.enabled){
|
||||
bot.chat('&aValid Hash')
|
||||
}else{
|
||||
source.sendFeedback({ text: 'Valid Hash', color: 'green' })
|
||||
}
|
||||
}else if (args[0] === ownerhash) {
|
||||
if(!bot.options.Core.enabled){
|
||||
bot.chat('&aValid Owner Hash')
|
||||
}else{
|
||||
source.sendFeedback({text: 'Valid Owner Hash', color:'green'})
|
||||
}
|
||||
}
|
||||
else if (discordHash) {
|
||||
if(!bot.options.Core.enabled){
|
||||
bot.chat('&aValid Hash')
|
||||
}else{
|
||||
source.sendFeedback({ text: 'Valid Hash', color: 'green' })
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//if (args[0] === hash) {
|
||||
@@ -1,34 +0,0 @@
|
||||
module.exports = {
|
||||
name: 'weather',
|
||||
description:['check the weather in a location via zip code or city name'],
|
||||
aliases:[],
|
||||
trustLevel: 0,
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
const args = context.arguments
|
||||
const source = context.source
|
||||
// const script = args.slice(1).join(' ');
|
||||
const weather = require('weather-js')
|
||||
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
|
||||
weather.find({degreeType:args[0], search:args.slice(1).join(' ')}, function(err, result){
|
||||
//"skytext" "feelslike" "humidity" "winddisplay"
|
||||
//{search: args.join(' '), degreeType: 'F'}
|
||||
source.sendFeedback([{text:`Location: `,color:'gray'},{text:`${result[0].location.name}`,color:'dark_green'}])
|
||||
|
||||
source.sendFeedback([{text:`Temperature: `,color:'gray'},{text:`${result[0].current.temperature}${result[0].location.degreetype}`,color:'dark_green'}])
|
||||
source.sendFeedback([{text:'Date: ',color:'gray'},{text:result[0].current.date,color:'dark_green'}])
|
||||
// console.log(JSON.stringify(result, null, 2));
|
||||
source.sendFeedback([{text:`${result[0].current.skytext}`,color:'dark_green'}])
|
||||
source.sendFeedback([{text:`Feels like `,color:'gray'},{text:`${result[0].current.feelslike}${result[0].location.degreetype}`,color:'dark_green'}])
|
||||
source.sendFeedback([{text:'Humidity ',color:'gray'},{text:`${result[0].current.humidity}`,color:'dark_green'}])
|
||||
source.sendFeedback([{text:'Wind Speed ',color:'gray'},{text:`${result[0].current.winddisplay}`,color:'dark_green'}])
|
||||
//if(result[0].location.alert === ''){
|
||||
//source.sendFeedback('There is no alerts!')
|
||||
//}else{
|
||||
source.sendFeedback(result[0].location.alert)
|
||||
//}
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
//const fetch = import("node-fetch");
|
||||
module.exports = {
|
||||
name: 'website',
|
||||
trustLevel:1,
|
||||
aliases:['web','websitedata','webdata'],
|
||||
description:['check website data'],
|
||||
async execute (context) {
|
||||
try{
|
||||
const fetch = require("node-fetch");
|
||||
const source = context.source
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
const args = context.arguments
|
||||
if (!args && !args[0] && !args[1] && !args[2]) return
|
||||
const response = await fetch(args[1]);
|
||||
const body = await response.text();
|
||||
|
||||
bot.tellraw({text:body,color:'green'})
|
||||
|
||||
} catch(e) {
|
||||
const bot = context.bot
|
||||
const source = context.source
|
||||
// source.sendFeedback({text:e.stack, color:'dark_red'})
|
||||
source.sendFeedback({text:e.toString(), color:'dark_red'})
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
const wiki = require('wikipedia') //
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'wiki',
|
||||
description:['wikipedia'],
|
||||
trustLevel: 0,
|
||||
aliases:['wikipedia'],
|
||||
async execute (context) {
|
||||
const source = context.source
|
||||
const args = context.arguments
|
||||
const bot = context.bot
|
||||
const ChatMessage = require('prismarine-chat')(bot.options.version)
|
||||
function sleep(ms) {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}
|
||||
const cmd = {
|
||||
translate: '[%s] ',
|
||||
bold: false,
|
||||
color: 'white',
|
||||
with: [
|
||||
{ color: 'dark_green', text: 'Wiki Cmd'},
|
||||
]
|
||||
}
|
||||
try {
|
||||
const page = await wiki.page(args.join(' '))
|
||||
// const summary = await page.images()
|
||||
const summary2 = await page.intro()
|
||||
|
||||
//const definitions = await urban.define(args.join(' '))
|
||||
/// console.log(summary)
|
||||
|
||||
// source.sendFeedback({ text: JSON.stringify(summary), color: 'green' })
|
||||
if (!bot.options.Core.enabled){
|
||||
bot.chat(ChatMessage.fromNotch(await sleep(500)
|
||||
?? [cmd, { text:summary2, color: 'gray' }]).toMotd().replaceAll('§', '&'))
|
||||
}else{
|
||||
source.sendFeedback([cmd,{ text:`${summary2}`, color: 'green' }])
|
||||
}
|
||||
} catch (e) {
|
||||
if(!bot.options.Core.enabled){
|
||||
bot.chat(ChatMessage.fromNotch([cmd, { text: `${e.toString()}`, color: 'red' }]).toMotd().replaceAll('§', '&'))
|
||||
}else{
|
||||
source.sendFeedback([cmd, { text: `${e}`, color: 'red' }])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
-65
@@ -1,65 +0,0 @@
|
||||
|
||||
{
|
||||
module.exports = {
|
||||
|
||||
bots: [
|
||||
{
|
||||
host: "serveriphere",
|
||||
username:username(),
|
||||
version:"1.20.2",
|
||||
reconnectDelay: 6000,
|
||||
endcredits:false,
|
||||
Console:{
|
||||
enabled: false,
|
||||
filelogging:false,
|
||||
prefix:'c.',
|
||||
},
|
||||
|
||||
|
||||
commands: {
|
||||
prefixes:
|
||||
["!", "!", "!"] // are those the prefixes?
|
||||
},
|
||||
Core: {
|
||||
customName:"corenamehere",
|
||||
enabled: false,
|
||||
interval:180000
|
||||
},
|
||||
discord: {
|
||||
channelId: "discordchannelidhere",
|
||||
invite: "discordinvitelinkhere",
|
||||
commandPrefix: "!"
|
||||
},
|
||||
selfcare: {
|
||||
vanished: false,
|
||||
unmuted: false,
|
||||
prefix: false,
|
||||
cspy: false,
|
||||
tptoggle:false,
|
||||
skin:false,
|
||||
gmc:false,
|
||||
op:false,
|
||||
nickname:false,
|
||||
username:false,
|
||||
god: false,
|
||||
interval:500,
|
||||
}
|
||||
},
|
||||
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function username() {
|
||||
const characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'; // remove sus characters like ` or like ( or whatever because it breaks whatever
|
||||
let username = '';
|
||||
for (let i = 0; i < 9; i++) {
|
||||
const randomIndex = Math.floor(Math.random() * characters.length);
|
||||
username += characters[randomIndex];
|
||||
}
|
||||
return username;
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
const util = require("util");
|
||||
const createBot = require("./bot.js");
|
||||
// TODO: Load a default config
|
||||
const fs = require("fs");
|
||||
const fileExist = require("./util/file-exists");
|
||||
const path = require("path");
|
||||
const readline = require("readline");
|
||||
|
||||
const rl = readline.createInterface({
|
||||
input: process.stdin,
|
||||
output: process.stdout,
|
||||
});
|
||||
|
||||
function load() {
|
||||
//const config = require('./config.js')
|
||||
|
||||
|
||||
|
||||
require("dotenv").config();
|
||||
const bots = [];
|
||||
for (const options of config.bots) {
|
||||
const bot = createBot(options);
|
||||
bots.push(bot);
|
||||
bot.bots = bots;
|
||||
bot.options.username;
|
||||
|
||||
bot.loadModule = (module) => module(bot, options);
|
||||
|
||||
for (const filename of fs.readdirSync(path.join(__dirname, "modules"))) {
|
||||
try {
|
||||
const module = require(path.join(__dirname, "modules", filename));
|
||||
bot.loadModule(module);
|
||||
} catch (error) {
|
||||
console.error(
|
||||
"Failed to load module",
|
||||
filename,
|
||||
":",
|
||||
error,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
bot.console.useReadlineInterface(rl);
|
||||
|
||||
|
||||
try {
|
||||
bot.on("error", console.error);
|
||||
} catch (error) {
|
||||
console.log(error.stack);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
async function checkConfig() {
|
||||
if (!(await fileExist(path.join(__dirname, "config.js")))) {
|
||||
console.error("Config not found! Creating a new Config from ");
|
||||
await fs.copyFileSync(
|
||||
path.join(__dirname, "default.js"),
|
||||
path.join(__dirname, "config.js"),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
config = require("./config.js");
|
||||
|
||||
load();
|
||||
}
|
||||
|
||||
checkConfig();
|
||||
@@ -1,5 +1,5 @@
|
||||
while true; do
|
||||
echo "Starting FNFBoyfriendBot...."
|
||||
node --trace-warnings .
|
||||
node --max-old-space-size=1000 src/index.js
|
||||
sleep 1
|
||||
done
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
put your midi files here
|
||||
@@ -1,30 +0,0 @@
|
||||
function command_loop_manager (bot, options) {
|
||||
bot.cloop = {
|
||||
list: [],
|
||||
|
||||
add (command, interval) {
|
||||
|
||||
this.list.push({ timer: setInterval(() => bot.core.run(command), interval), command, interval })
|
||||
},
|
||||
|
||||
/*
|
||||
if (message.startsWith('/')) {
|
||||
bot.command(message.substring(1))
|
||||
return
|
||||
}
|
||||
bot.chat(message)
|
||||
*/
|
||||
remove (index) {
|
||||
clearInterval(this.list[index].timer)
|
||||
},
|
||||
|
||||
clear () {
|
||||
for (const cloop of this.list) clearInterval(cloop.timer)
|
||||
|
||||
this.list = []
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = command_loop_manager
|
||||
@@ -1,231 +0,0 @@
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const CommandError = require("../CommandModules/command_error.js");
|
||||
const { PermissionsBitField, Client, Events, GatewayIntentBits } = require('discord.js');
|
||||
//check command_source
|
||||
//it would be both the command_source.js and command_manager.js files
|
||||
async function command_manager(bot, options) {
|
||||
bot.commandManager = {
|
||||
commands: {},
|
||||
commandlist: [],
|
||||
//ohio
|
||||
execute(source, commandName, args, message) {
|
||||
const command = this.getCommand(commandName.toLowerCase());
|
||||
//Unknown command. Type "/help" for help
|
||||
const now = new Date().toLocaleString("en-US", {
|
||||
timeZone: "America/CHICAGO",
|
||||
});
|
||||
try {
|
||||
|
||||
|
||||
if(source.sources.console && !source.sources.discord){
|
||||
if (!command || !command.execute) {
|
||||
bot.console.warn({text:`Unknown Command ${commandName}. type "${bot.options.Console.prefix}help" for help`,color:'dark_red'})
|
||||
}
|
||||
}else if(source.sources.discord && !source.sources.console) {
|
||||
if (!command || !command.execute) {
|
||||
throw new CommandError(`Unknown Command ${commandName}. Type "${bot.options.discord.commandPrefix}help" for help`)
|
||||
}
|
||||
}else if(!source.sources.discord && !source.sources.console) {
|
||||
if (!bot.options.Core.enabled){
|
||||
if (!command || !command.execute) {
|
||||
throw new CommandError(`Unknown command ${commandName}. Type "${bot.options.commands.prefixes[0]}help" for help`)
|
||||
}
|
||||
}else{
|
||||
if (!command || !command.execute) { // bot.options.command.prefixes[0]
|
||||
throw new CommandError({ // sus
|
||||
translate: `Unknown command %s. Type "${bot.options.commands.prefixes[0]}help" for help or click on this for the command`,
|
||||
with: [commandName],
|
||||
clickEvent: 'https://discord.gg'
|
||||
|
||||
? {//fr
|
||||
// theme moment
|
||||
action: "suggest_command",
|
||||
value: `${bot.options.commands.prefixes[0]}help`,
|
||||
}
|
||||
: undefined,
|
||||
}); //ohio
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (command?.trustLevel > 0) {
|
||||
|
||||
const event = source.discordMessageEvent
|
||||
|
||||
const roles = message?.member?.roles?.cache
|
||||
|
||||
if (
|
||||
|
||||
source.sources.discord &&
|
||||
command.trustLevel === 1 &&
|
||||
|
||||
!roles?.some((role) => role.name === 'Trusted' || role.name === 'FNFBoyfriendBot Owner')
|
||||
)
|
||||
throw new CommandError({
|
||||
text: "You are not Trusted!",
|
||||
color: "red",
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
if (
|
||||
!source?.sources?.discord &&
|
||||
!source?.sources?.console &&
|
||||
command.trustLevel === 1 &&
|
||||
args[0] !== bot.hash &&
|
||||
args[0] !== bot.owner &&
|
||||
args[0] !== bot.hashing.hash
|
||||
) if (!bot.options.Core.enabled){
|
||||
|
||||
throw new CommandError('&4Invalid Hash or Invalid Owner Hash')
|
||||
// throw new CommandError('')
|
||||
}else{
|
||||
throw new CommandError({
|
||||
text: "Invalid Hash or Invalid Owner Hash",
|
||||
color: "red",
|
||||
});
|
||||
}
|
||||
bot.hashing.updateHash();
|
||||
const now = new Date().toLocaleString("en-US", {
|
||||
timeZone: "America/CHICAGO",
|
||||
});
|
||||
const player = source?.player?.profile?.name;
|
||||
const uuid = source?.player?.uuid;
|
||||
const time = new Date().toLocaleTimeString("en-US", {
|
||||
timeZone: "America/CHICAGO",
|
||||
});
|
||||
const date = new Date().toLocaleDateString("en-US", {
|
||||
timeZone: "America/CHICAGO",
|
||||
});
|
||||
|
||||
bot.console.hash = function (error, source) {
|
||||
console.log(
|
||||
`<\x1b[0m\x1b[35m${time} \x1b[0m\x1b[96m${date}\x1b[0m> [${bot.options.host}:${bot.options.port}\x1b[0m] ` +
|
||||
`[\x1b[0m\x1b[92mHash\x1b[0m]: \x1b[0m\x1b[92mPlayer\x1b[0m: ${player}, \x1b[0m\x1b[92mUUID\x1b[0m:${uuid}, \x1b[0m\x1b[92mHash\x1b[0m:${
|
||||
bot.hash || bot.hashing.hash
|
||||
}\x1b[0m]`,
|
||||
);
|
||||
};
|
||||
bot.console.discordHash = function (error, source) {
|
||||
console.log(
|
||||
`<\x1b[0m\x1b[35m${time} \x1b[0m\x1b[96m${date}\x1b[0m> [${bot.options.host}:${bot.options.port}\x1b[0m] ` +
|
||||
`[\x1b[0m\x1b[92mHash\x1b[0m]: \x1b[0m\x1b[92mPlayer\x1b[0m: ${player}, \x1b[0m\x1b[92mUUID\x1b[0m:${uuid}, \x1b[0m\x1b[92mHash\x1b[0m:${bot.hashing.hash}\x1b[0m]`,
|
||||
);
|
||||
};
|
||||
bot.console.ownerHash = function (error, source) {
|
||||
console.log(
|
||||
`<\x1b[0m\x1b[35m${time} \x1b[0m\x1b[96m${date}\x1b[0m> [${bot.options.host}:${bot.options.port}\x1b[0m] ` +
|
||||
`[\x1b[0m\x1b[31mOwnerHash\x1b[0m]: \x1b[0m\x1b[92mPlayer\x1b[0m: ${player}, \x1b[0m\x1b[92mUUID\x1b[0m:${uuid}, \x1b[0m\x1b[31mOwnerHash\x1b[0m:${bot.owner}\x1b[0m]`,
|
||||
);
|
||||
};
|
||||
if (args[0] === bot.hash) {
|
||||
bot.console.hash();
|
||||
} else if (args[0] === bot.owner) {
|
||||
bot.console.ownerHash();
|
||||
}
|
||||
if (
|
||||
source?.sources?.discord &&
|
||||
command.trustLevel === 2 &&
|
||||
!roles?.some((role) => role.name === "FNFBoyfriendBot Owner")
|
||||
)
|
||||
|
||||
throw new CommandError({
|
||||
text: "You are not the Owner!",
|
||||
color: "dark_red",
|
||||
});
|
||||
const owner = `${args[0]}`;
|
||||
if (
|
||||
!source?.sources?.discord &&
|
||||
!source?.sources?.console &&
|
||||
command.trustLevel === 2 &&
|
||||
owner !== bot.owner
|
||||
)
|
||||
if (!bot.options.Core.enabled){
|
||||
|
||||
throw new CommandError('&4Invalid Owner Hash')
|
||||
}else{
|
||||
throw new CommandError({
|
||||
text: "Invalid Owner Hash",
|
||||
color: "dark_red",
|
||||
});
|
||||
}
|
||||
if (command.trustLevel === 3 && !source?.sources?.console)
|
||||
if(!bot.options.Core.enabled){
|
||||
throw new CommandError('&9This command can only be execute via console')
|
||||
}else{
|
||||
throw new CommandError({
|
||||
translate: "This command can only be executed via console",
|
||||
color: "blue",
|
||||
});
|
||||
}
|
||||
}
|
||||
return command?.execute({ bot, source, arguments: args });
|
||||
} catch (error) {
|
||||
const now = new Date().toLocaleString("en-US", {
|
||||
timeZone: "America/CHICAGO",
|
||||
});
|
||||
bot.console.warn(error.stack);
|
||||
|
||||
if (!bot.options.Core.enabled){
|
||||
if (error instanceof CommandError)
|
||||
bot.chat(error._message)
|
||||
else bot.chat('a error has occured!')
|
||||
} else {
|
||||
if (error instanceof CommandError)
|
||||
source.sendError(error._message)
|
||||
else source.sendError({
|
||||
translate: "An Error has occured because the bot shot itself 🔫",
|
||||
color: "red",
|
||||
hoverEvent: { action: "show_text", contents: String(error.stack) },
|
||||
});
|
||||
}
|
||||
//
|
||||
|
||||
|
||||
|
||||
if (source.sources.discord) {
|
||||
source.sendError(error);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
executeString(source, command) {
|
||||
const [commandName, ...args] = command.split(" ");
|
||||
return this.execute(source, commandName, args);
|
||||
},
|
||||
register(command) {
|
||||
this.commands[command.name] = command;
|
||||
|
||||
if (command.aliases) {
|
||||
command.aliases.map((a) => (this.commands[a] = command));
|
||||
}
|
||||
},
|
||||
getCommand(name) {
|
||||
return this.commands[name];
|
||||
},
|
||||
|
||||
getCommands() {
|
||||
return Object.values(this.commands);
|
||||
},
|
||||
};
|
||||
//
|
||||
commandlist = [];
|
||||
|
||||
for (const filename of fs.readdirSync(path.join(__dirname, "../commands"))) {
|
||||
try {
|
||||
const command = require(path.join(__dirname, "../commands", filename));
|
||||
bot.commandManager.register(command);
|
||||
bot.commandManager.commandlist.push(command);
|
||||
} catch (error) {
|
||||
console.error("Failed to load command", filename, ":", error);
|
||||
}
|
||||
|
||||
if (process.env["anti-skid"] !== "amogus is sus") {
|
||||
process.exit(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
module.exports = command_manager;
|
||||
@@ -1,52 +0,0 @@
|
||||
function memusage(bot, options) {
|
||||
const clamp = require("../util/clamp");
|
||||
const bossbarName = "memusage";
|
||||
|
||||
const os = require("os");
|
||||
let enabled = false;
|
||||
let tag = "FNFBoyfriendBotMemusage";
|
||||
bot.memusage = {
|
||||
on() {
|
||||
enabled = true;
|
||||
},
|
||||
off() {
|
||||
enabled = false;
|
||||
bot.core.run(`minecraft:bossbar remove ${bossbarName}`);
|
||||
},
|
||||
};//
|
||||
|
||||
|
||||
const interval = setInterval(() => {
|
||||
if (!enabled) return;
|
||||
|
||||
/* const component = {
|
||||
text: `Mem used ${Math.floor(
|
||||
process.memoryUsage().heapUsed / 1000 / 1000,
|
||||
)} MiB / ${Math.floor(
|
||||
process.memoryUsage().heapTotal / 1000 / 1000,
|
||||
)} MiB. `,
|
||||
color: "dark_gray",
|
||||
};*/
|
||||
const component = {
|
||||
translate: `memusage %s`,
|
||||
color: "gray",
|
||||
bold: false,
|
||||
with: [{ text: `Memory used ${Math.floor(
|
||||
process.memoryUsage().heapUsed / 1000 / 1000,
|
||||
)} Mebibytes / ${Math.floor(
|
||||
process.memoryUsage().heapTotal / 1000 / 1000,
|
||||
)} Mebibytes.`, color: "green" }],
|
||||
};
|
||||
//process.cpuUsage
|
||||
bot.core.run(`minecraft:bossbar add ${bossbarName} ""`);
|
||||
bot.core.run(`minecraft:bossbar set ${bossbarName} players @a`);
|
||||
bot.core.run(`minecraft:bossbar set ${bossbarName} color yellow`);
|
||||
bot.core.run(`minecraft:bossbar set ${bossbarName} visible true`);
|
||||
bot.core.run(`minecraft:bossbar set ${bossbarName} style progress`);
|
||||
bot.core.run(
|
||||
`minecraft:bossbar set ${bossbarName} name ${JSON.stringify(component)}`,
|
||||
);
|
||||
bot.core.run(`minecraft:bossbar set ${bossbarName} max 20`);
|
||||
}, 100); //process.memoryUsage().heapUsed /1024 / 1024
|
||||
}
|
||||
module.exports = memusage;
|
||||
@@ -1,18 +0,0 @@
|
||||
const mc = require('minecraft-protocol')
|
||||
|
||||
function reconnect (bot, options) {
|
||||
bot.reconnectDelay = options.reconnectDelay ?? 5200 // Set from 1000 to 5200 - yfd
|
||||
|
||||
bot.on('end', (reason) => {
|
||||
if (bot.reconnectDelay < 0) return
|
||||
setTimeout(() => {
|
||||
|
||||
const client = options.client ?? mc.createClient(options)
|
||||
|
||||
bot._client = client
|
||||
console.log(`Reconnecting to ${bot.options.host}:${bot.options.port}`)
|
||||
bot.emit('init_client', client)
|
||||
}, bot.reconnectDelay)
|
||||
})
|
||||
}
|
||||
module.exports = reconnect
|
||||
@@ -1,11 +0,0 @@
|
||||
const createRegistry = require('prismarine-registry')
|
||||
|
||||
function registry (bot) {
|
||||
bot.on('packet.login', packet => {
|
||||
bot.registry = createRegistry(bot._client.version)
|
||||
// bot.registry.loadDimensionCodec(packet.dimensionCodec)
|
||||
bot.emit('registry_ready', bot.registry)
|
||||
})
|
||||
}
|
||||
//1.20.2 support wooooooo
|
||||
module.exports = registry
|
||||
@@ -1,161 +0,0 @@
|
||||
|
||||
const util = require('util')
|
||||
|
||||
const COMMANDSPY_ENABLED_MESSAGE = { text: 'Successfully enabled CommandSpy' }
|
||||
const COMMANDSPY_DISABLED_MESSAGE = { text: 'Successfully disabled CommandSpy' }
|
||||
//You now have the tag: &8[&bPrefix &4d~&8]
|
||||
function selfcare (bot) {
|
||||
let entityId
|
||||
let gameMode
|
||||
let permissionLevel = 2
|
||||
let unmuted = false
|
||||
let commandSpyEnabled = false
|
||||
let vanished = false
|
||||
let prefix = false
|
||||
let skin = false
|
||||
let username = false
|
||||
let nickname = false
|
||||
let god = false
|
||||
let tptoggle = false
|
||||
let jail = false
|
||||
/* if (data.toString().startsWith('You have been muted')) muted = true
|
||||
if (data.toString() === 'You have been unmuted.') muted = false
|
||||
*/
|
||||
//bot.on('message', (data) => {
|
||||
bot.on('message', (message, data) => {
|
||||
// Successfully removed your skin
|
||||
const stringmessage = bot.getMessageAsPrismarine(message)?.toString()
|
||||
if (stringmessage.startsWith('You have been muted')) unmuted = true
|
||||
else if (stringmessage === "You have been unmuted.") unmuted = false
|
||||
else if (util.isDeepStrictEqual(message, COMMANDSPY_ENABLED_MESSAGE)) commandSpyEnabled = true
|
||||
else if (util.isDeepStrictEqual(message, COMMANDSPY_DISABLED_MESSAGE)) commandSpyEnabled = false
|
||||
else if (stringmessage === `You now have the tag: &8[&bPrefix &4${bot.options.commands.prefixes[0]}&8]`) {
|
||||
prefix = true
|
||||
return
|
||||
}
|
||||
else if (stringmessage.startsWith("You now have the tag: ") || stringmessage === "You no longer have a tag") prefix = false
|
||||
|
||||
else if (stringmessage === `Successfully set your skin to ${bot.options.selfcare.skin.player}'s`) {
|
||||
skin = true
|
||||
return
|
||||
}
|
||||
//Successfully set your skin to Parker2991's
|
||||
//Successfully removed your skin
|
||||
else if (stringmessage === 'You have been released!') jail = true
|
||||
else if (stringmessage === 'Jails/Unjails a player, TPs them to the jail specified.') jail = true
|
||||
else if(stringmessage === `You have been jailed!`){
|
||||
jail = false
|
||||
return
|
||||
}
|
||||
else if (stringmessage.startsWith("Successfully set your skin to ") || stringmessage === "Successfully removed your skin") skin = false
|
||||
|
||||
else if (stringmessage === `Successfully set your username to "${bot.username}"`) {
|
||||
username = true
|
||||
return
|
||||
}//"Successfully set your username to "${bot.username}"""
|
||||
else if (stringmessage.startsWith("Successfully set your username to ")) username = false
|
||||
else if (stringmessage === `You already have the username "${bot.username}"`) username = true
|
||||
//That name is already in use.
|
||||
//Error: Nicknames must be alphanumeric.
|
||||
//You no longer have a nickname.
|
||||
//Your nickname is now sus.
|
||||
else if (stringmessage === `You no longer have a nickname.`) {
|
||||
nickname = true
|
||||
return
|
||||
}//"Successfully set your username to "${bot.username}"""
|
||||
else if (stringmessage.startsWith("Your nickname is now ")) nickname = false
|
||||
// else if (stringmessage === `Error: Nicknames must be alphanumeric.`) nickname = false
|
||||
else if (stringmessage === `You no longer have a nickname.`) nickname = false
|
||||
//else if (stringmessage === `That name is already in use.`) nickname = false
|
||||
//God mode enabled.
|
||||
//God mode disabled.
|
||||
else if (stringmessage === `God mode enabled.`) {
|
||||
god = true
|
||||
return
|
||||
}
|
||||
else if (stringmessage === 'God mode disabled.') god = false
|
||||
else if (stringmessage === `Teleportation enabled.`) {
|
||||
tptoggle = false
|
||||
return
|
||||
}
|
||||
else if (stringmessage === 'Teleportation disabled.') tptoggle = true
|
||||
|
||||
else if(stringmessage === `Vanish for ${bot.options.username}: disabled`) {
|
||||
vanished = false
|
||||
return
|
||||
}
|
||||
else if (stringmessage === `Vanish for ${bot.options.username}: enabled`) vanished = true
|
||||
|
||||
/*
|
||||
else if (message?.text !== '' || !Array.isArray(message.extra) || message.extra.length < 2 || !message.extra[0]?.text?.startsWith('Vanish for') || message.extra[0].color !== 'gold') return
|
||||
|
||||
const suffix = message.extra[message.extra.length - 1]
|
||||
|
||||
if (suffix?.color !== 'gold') return
|
||||
//data.toString().startsWith
|
||||
if (suffix.text?.endsWith(': enabled')) vanished = true
|
||||
else if (suffix.text?.endsWith(': disabled')) vanished = false // Bruh what is this ohio code
|
||||
//
|
||||
|
||||
*/
|
||||
})
|
||||
|
||||
bot.on('packet.entity_status', packet => {
|
||||
if (packet.entityId !== entityId || packet.entityStatus < 24 || packet.entityStatus > 28) return
|
||||
permissionLevel = packet.entityStatus - 24
|
||||
})//
|
||||
//TO-DO create a array for nick, prefix, and mabe username in selfcare so that when it joins or has the nick/prefix changed it will change it back to the set nick and prefix in selfcare
|
||||
|
||||
bot.on('packet.game_state_change', packet => {
|
||||
if (packet.reason !== 3) return // Reason 3 = Change Game Mode
|
||||
|
||||
gameMode = packet.gameMode
|
||||
})
|
||||
|
||||
let timer
|
||||
bot.on('packet.login', (packet) => {
|
||||
entityId = packet.entityId
|
||||
gameMode = packet.gameMode
|
||||
|
||||
timer = setInterval(() => {
|
||||
if (permissionLevel < 2 && bot.options.selfcare.op) bot.command('op @s[type=player]')
|
||||
|
||||
if (!commandSpyEnabled && bot.options.selfcare.cspy) bot.command('commandspy:commandspy on')
|
||||
|
||||
else if (unmuted && bot.options.selfcare.unmuted) bot.core.run(`essentials:mute ${bot.uuid}`)
|
||||
else if (!prefix && bot.options.selfcare.prefix) bot.command(`prefix &8[&bPrefix &4${bot.options.commands.prefixes[0]}&8]`)
|
||||
else if (gameMode !== 1 && bot.options.selfcare.gmc) bot.command('gamemode creative @s[type=player]')
|
||||
else if (!skin && bot.options.selfcare.skin.enabled) bot.command(`skin ${bot.options.selfcare.skin.player}`)
|
||||
else if (!username && bot.options.selfcare.username) bot.command(`username ${bot.username}`)
|
||||
else if (!nickname && bot.options.selfcare.nickname) bot.command(`nick off`)
|
||||
else if (!god && bot.options.selfcare.god) bot.command('god on')
|
||||
else if (!tptoggle && bot.options.selfcare.tptoggle) bot.command('tptoggle off')
|
||||
else if (!vanished && bot.options.selfcare.vanished) bot.core.run(`essentials:vanish ${bot.username} enable`)
|
||||
else if (!jail) bot.command(`unjail ${bot.username}`)
|
||||
}, bot.options.selfcare.interval)
|
||||
})
|
||||
|
||||
bot.on('end', () => {
|
||||
if (timer) clearInterval(timer)
|
||||
prefix = false
|
||||
muted = false
|
||||
commandSpyEnabled = false
|
||||
vanished = false
|
||||
skin = false
|
||||
username = false
|
||||
nickname = false
|
||||
god = false
|
||||
tptoggle = false
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = selfcare
|
||||
/*const buildstring = process.env['buildstring']
|
||||
bot.on('login', async () => {
|
||||
console.log(`starting ${buildstring}`)
|
||||
await bot.discord.channel.send(`Starting ${buildstring}`)
|
||||
await sendChat('/prefix &8[&4Prefix ~ &8]')
|
||||
await sendChat(buildstring)
|
||||
await sendChat('Prefix ~')
|
||||
})
|
||||
}*/
|
||||
+29
-19
@@ -1,9 +1,11 @@
|
||||
const path = require('path')
|
||||
const fs = require('fs')
|
||||
const { Midi } = require('@tonejs/midi')
|
||||
const { convertMidi } = require('../util/midi_converter')
|
||||
const convertNBS = require('../util/nbs_converter')
|
||||
const parseTXTSong = require('../util/txt_song_parser')
|
||||
|
||||
const midiproxy = require('../util/midi-proxy')
|
||||
midiproxy()
|
||||
const soundNames = {
|
||||
harp: 'minecraft:block.note_block.harp',
|
||||
basedrum: 'minecraft:block.note_block.basedrum',
|
||||
@@ -23,7 +25,7 @@ const soundNames = {
|
||||
pling: 'minecraft:block.note_block.pling'
|
||||
}
|
||||
|
||||
function inject (bot) {
|
||||
async function inject (bot) {
|
||||
bot.music = function () {}
|
||||
bot.music.song = null
|
||||
bot.music.loop = 0
|
||||
@@ -40,7 +42,14 @@ function inject (bot) {
|
||||
}
|
||||
resetTime()
|
||||
}
|
||||
|
||||
const midisFolder = path.join(__dirname, '../../midis'); // idfk
|
||||
//why is it not trying to find the folder tf
|
||||
// i am having a stroke from this
|
||||
try {
|
||||
if (!fs.existsSync(midisFolder)) {
|
||||
fs.mkdirSync(midisFolder);
|
||||
}
|
||||
}catch(e) {}
|
||||
const bossbarName = 'music' // maybe make this in the config?
|
||||
|
||||
const selector = '@a[tag=!nomusic]'
|
||||
@@ -49,26 +58,30 @@ function inject (bot) {
|
||||
if (!bot.music.queue.length) return
|
||||
bot.music.song = bot.music.queue[0]
|
||||
time = Date.now() - startTime
|
||||
/*
|
||||
// bot.core.run('minecraft:title @a[tag=!nomusic] actionbar ' + JSON.stringify(toComponent()))
|
||||
|
||||
// is spamming commands in core as a self care a good idea?
|
||||
// btw this is totallynotskidded™️ from my song bot except the bossbarName (above)
|
||||
// bot.core.run('minecraft:title @a[tag=!nomusic] actionbar ' + JSON.stringify(toComponent()))
|
||||
await bot.chatDelay(150)
|
||||
bot.core.run(`minecraft:bossbar add ${bossbarName} ""`) // is setting the name to "" as a placeholder a good idea?
|
||||
await bot.chatDelay(150)
|
||||
bot.core.run(`minecraft:bossbar set ${bossbarName} players ${selector}`)
|
||||
bot.core.run(`minecraft:bossbar set ${bossbarName} name ${JSON.stringify(toComponent())}`)
|
||||
await bot.chatDelay(150)
|
||||
bot.core.run(`minecraft:bossbar set ${bossbarName} name ${JSON.stringify(bot.getMessageAsPrismarine(toComponent()).toMotd())}`)
|
||||
await bot.chatDelay(150)
|
||||
bot.core.run(`minecraft:bossbar set ${bossbarName} color yellow`) // should i use purple lol
|
||||
await bot.chatDelay(150)
|
||||
bot.core.run(`minecraft:bossbar set ${bossbarName} visible true`)
|
||||
await bot.chatDelay(150)
|
||||
bot.core.run(`minecraft:bossbar set ${bossbarName} value ${Math.floor(time)}`)
|
||||
await bot.chatDelay(150)
|
||||
bot.core.run(`minecraft:bossbar set ${bossbarName} max ${bot.music.song.length}`)
|
||||
*/
|
||||
bot.core.run(`title @a actionbar ${JSON.stringify(toComponent())}`)
|
||||
bot.core.run(`minecraft:bossbar set ${bossbarName} visible true`)
|
||||
await bot.chatDelay(150)
|
||||
bot.core.run(`title @a actionbar ${JSON.stringify(bot.getMessageAsPrismarine(toComponent()).toMotd())}`)
|
||||
await bot.chatDelay(150)
|
||||
|
||||
while (bot.music.song?.notes[noteIndex]?.time <= time) {
|
||||
const note = bot.music.song.notes[noteIndex]
|
||||
const floatingPitch = 2 ** ((note.pitch - 12) / 12.0)
|
||||
// bot.core.run(`playsound ${soundNames[note.instrument]} record @s ~ ~ ~ ${note.volume} ${floatingPitch}`)
|
||||
bot.core.run(`minecraft:execute as ${selector} at @s run playsound ${soundNames[note.instrument]} record @s ~ ~ ~ ${note.volume} ${floatingPitch}`)
|
||||
bot.core.run(`minecraft:execute as ${selector} at @s run playsound ${soundNames[note.instrument]} record @s ~ ~ ~ ${note.volume} ${floatingPitch}`)
|
||||
noteIndex++
|
||||
if (noteIndex >= bot.music.song.notes.length) {
|
||||
bot.tellraw([
|
||||
@@ -107,7 +120,8 @@ bot.core.run(`minecraft:bossbar set ${bossbarName} visible true`)
|
||||
}, 100)
|
||||
|
||||
bot.on('end', () => {
|
||||
clearInterval(interval)
|
||||
// clearInterval(interval)
|
||||
bot.music.stop()
|
||||
})
|
||||
|
||||
bot.music.load = async function (buffer, fallbackName = '[unknown]') {
|
||||
@@ -159,11 +173,7 @@ bot.core.run(`minecraft:bossbar set ${bossbarName} visible true`)
|
||||
|
||||
function toComponent () {
|
||||
const component = [
|
||||
// { text: '[', color: 'dark_gray' },
|
||||
// { text: 'ChomeNS Bot', color: 'yellow' },
|
||||
// { text: '] ', color: 'dark_gray' },
|
||||
// { text: 'Now Playing', color: 'gold' },
|
||||
// { text: ' | ', color: 'dark_gray' },
|
||||
|
||||
{ text: bot.music.song.name, color: 'green' },
|
||||
{ text: ' | ', color: 'dark_gray' },
|
||||
{ text: formatTime(time), color: 'gray' },
|
||||
@@ -1,62 +0,0 @@
|
||||
const nbs = require('./nbs-file.js')
|
||||
const instrumentNames = [
|
||||
'harp',
|
||||
'bass',
|
||||
'basedrum',
|
||||
'snare',
|
||||
'hat',
|
||||
'guitar',
|
||||
'flute',
|
||||
'bell',
|
||||
'chime',
|
||||
'xylophone',
|
||||
'iron_xylophone',
|
||||
'cow_bell',
|
||||
'didgeridoo',
|
||||
'bit',
|
||||
'banjo',
|
||||
'pling'
|
||||
]
|
||||
|
||||
function convertNBS (buf) {
|
||||
const parsed = nbs.parse(buf)
|
||||
const song = {
|
||||
name: parsed.songName,
|
||||
notes: [],
|
||||
loop: false,
|
||||
loopPosition: 0,
|
||||
length: 0
|
||||
}
|
||||
if (parsed.loop > 0) {
|
||||
song.loop = true
|
||||
song.loopPosition = parsed.loopStartTick
|
||||
}
|
||||
for (const note of parsed.nbsNotes) {
|
||||
let instrument = note.instrument
|
||||
if (note.instrument < instrumentNames.length) {
|
||||
instrument = instrumentNames[note.instrument]
|
||||
} else continue
|
||||
|
||||
if (note.key < 33 || note.key > 55) continue
|
||||
|
||||
const layerVolume = 100
|
||||
// will add layer volume later
|
||||
|
||||
const time = tickToMs(note.tick, parsed.tempo)
|
||||
song.length = Math.max(song.length, time)
|
||||
|
||||
song.notes.push({
|
||||
instrument,
|
||||
pitch: note.key - 33,
|
||||
volume: note.velocity * layerVolume / 10000,
|
||||
time
|
||||
})
|
||||
}
|
||||
return song
|
||||
}
|
||||
|
||||
function tickToMs (tick = 1, tempo) {
|
||||
return Math.floor(1000 * tick * 100 / tempo)
|
||||
}
|
||||
|
||||
module.exports = convertNBS
|
||||
Generated
+286
-3058
File diff suppressed because it is too large
Load Diff
+12
-22
@@ -2,36 +2,26 @@
|
||||
"dependencies": {
|
||||
"@tonejs/midi": "^2.0.28",
|
||||
"@vitalets/google-translate-api": "^9.2.0",
|
||||
"axios": "^1.6.2",
|
||||
"chalk": "^5.3.0",
|
||||
"chromium": "^3.0.3",
|
||||
"axios": "^1.6.8",
|
||||
"color-convert": "^2.0.1",
|
||||
"cowsay2": "^2.0.4",
|
||||
"discord.js": "^14.14.1",
|
||||
"dockerode": "^4.0.2",
|
||||
"dotenv": "^16.3.1",
|
||||
"dotenv": "^16.4.5",
|
||||
"final-stream": "^2.0.4",
|
||||
"http-proxy-agent": "^7.0.2",
|
||||
"https": "^1.0.0",
|
||||
"isolated-vm": "^4.7.2",
|
||||
"minecraft-data": "^3.61.0",
|
||||
"minecraft-protocol": "^1.46.0",
|
||||
"minecraft-protocol-forge": "^1.0.0",
|
||||
"mineflayer": "^4.14.0",
|
||||
"mineflayer-cmd": "^1.1.3",
|
||||
"matrix-js-sdk": "^31.6.1",
|
||||
"minecraft-protocol": "^1.47.0",
|
||||
"moment-timezone": "^0.5.45",
|
||||
"node_characterai": "^1.2.4",
|
||||
"node-fetch": "^2.7.0",
|
||||
"prismarine-chat": "^1.9.1",
|
||||
"prismarine-nbt": "^2.2.1",
|
||||
"prismarine-physics": "^1.8.0",
|
||||
"prismarine-chat": "^1.10.0",
|
||||
"prismarine-registry": "^1.7.0",
|
||||
"randomstring": "^1.3.0",
|
||||
"querystring": "^0.2.1",
|
||||
"readline": "^1.3.0",
|
||||
"sharp": "^0.32.6",
|
||||
"urban-dictionary": "git+https://code.chipmunk.land/ChipmunkMC/urban-dictionary.git",
|
||||
"urban-dictionary-client": "^3.1.0",
|
||||
"uuid-by-string": "^4.0.0",
|
||||
"vec3": "^0.1.8",
|
||||
"vm2": "^3.9.19",
|
||||
"stream": "^0.0.2",
|
||||
"urban-dictionary": "git+https://code.chipmunk.land/chipmunkMC/urban-dictionary.git",
|
||||
"weather-js": "^2.0.0",
|
||||
"wikipedia": "^2.1.1"
|
||||
"wikipedia": "^2.1.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
# i bet theres gonna be some whiny assholes complaining about this because config is .yml and not .js since most java bots use .yml and no other
|
||||
# javascript bot uses .yml, all i got to say is go cry somewhere else about it you wont change my mind, you little shit,
|
||||
# it looks cleaner than config.js - Parker2991
|
||||
|
||||
|
||||
# FNFBoyfriendBot Config
|
||||
# commands
|
||||
Commands:
|
||||
prefixes:
|
||||
- '!'
|
||||
colors:
|
||||
discord:
|
||||
error: "#ff0000"
|
||||
embed: "#00ffff"
|
||||
help:
|
||||
pub_lickColor: "#00FFFF"
|
||||
t_rustedColor: "dark_purple"
|
||||
own_herColor: "dark_red"
|
||||
error: "#FF0000"
|
||||
|
||||
# core
|
||||
Core:
|
||||
JSON: ""
|
||||
area:
|
||||
start:
|
||||
x: 0
|
||||
y: 0
|
||||
z: 0
|
||||
end:
|
||||
x: 15
|
||||
y: 0
|
||||
z: 15
|
||||
|
||||
#validation
|
||||
validation:
|
||||
discord:
|
||||
roles:
|
||||
trusted: "trusted"
|
||||
owner: "owner"
|
||||
channelId: "channel validation here" # for sending hashes to discord if someone is too lazy to add validation for the bot to their client
|
||||
trustedKey: "trusted key here"
|
||||
ownerKey: "owner key here"
|
||||
|
||||
#discord
|
||||
Discord:
|
||||
enabled: false
|
||||
invite: "https://discord.gg/GCKtG4erux"
|
||||
commandPrefix: "!"
|
||||
presence:
|
||||
name: "amongus"
|
||||
type: 4
|
||||
status: "online"
|
||||
|
||||
# console
|
||||
console:
|
||||
filelogging: false
|
||||
prefix: "c."
|
||||
|
||||
# bots
|
||||
bots :
|
||||
# isKaboom = running the bot in kaboom
|
||||
# isCreayun = running the bot in creayun
|
||||
# useChat = running the bot in chat and not core
|
||||
# usernameGen = regenerating the bot's username every join
|
||||
# endcredits = the bot advertising
|
||||
# serverName = the name of the server ofc
|
||||
# Console.ratelimit = the number of messages that the bot can read in a few seconds before rejoining this is used to prevent spam, i do not recommend setting it to Infinity
|
||||
# selfcare.interval = selfcare interval duh
|
||||
- host: "localhost"
|
||||
useChat: false
|
||||
isKaboom: true
|
||||
isCreayun: false
|
||||
usernameGen: true
|
||||
username: "FNFBoyfriendBot"
|
||||
version: "1.20.2"
|
||||
serverName: "localhost"
|
||||
reconnectDelay: 6000
|
||||
endcredits: false
|
||||
Console:
|
||||
enabled: true
|
||||
ratelimit: 25
|
||||
Core:
|
||||
enabled: true
|
||||
interval: 180000
|
||||
discord:
|
||||
channelId: ""
|
||||
log: false
|
||||
matrix:
|
||||
roomId: ""
|
||||
selfcare:
|
||||
vanished: true
|
||||
unmuted: true
|
||||
prefix: true
|
||||
cspy: true
|
||||
tptoggle: true
|
||||
skin: true
|
||||
gmc: true
|
||||
op: true
|
||||
nickname: true
|
||||
username: true
|
||||
god: true
|
||||
interval: 500
|
||||
@@ -0,0 +1,94 @@
|
||||
const CommandError = require('./CommandModules/command_error.js');
|
||||
const util = require("util");
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const parseYaml = require('js-yaml')
|
||||
/* if (!fs.existsSync('config.js')) {
|
||||
console.log('Config not found creating config from default.js');
|
||||
fs.copyFileSync(
|
||||
path.join(__dirname, 'default.yml'),
|
||||
path.join(__dirname, 'config.js'),
|
||||
);
|
||||
}; */
|
||||
if (!fs.existsSync('config.yml')) {
|
||||
console.log('Config not found creating config from default.yml');
|
||||
fs.copyFileSync(
|
||||
path.join(__dirname, 'default.yml'),
|
||||
path.join(__dirname, 'config.yml'),
|
||||
);
|
||||
};
|
||||
// const config = require(`../config.js`);
|
||||
try {
|
||||
config = parseYaml.load(fs.readFileSync('config.yml', 'utf8'));
|
||||
console.log(config)
|
||||
} catch (e) {
|
||||
console.log(e.toString())
|
||||
}
|
||||
const { createBot } = require('./bot.js');
|
||||
const readline = require("readline");
|
||||
|
||||
const rl = readline.createInterface({
|
||||
input: process.stdin,
|
||||
output: process.stdout,
|
||||
});
|
||||
|
||||
function load() {
|
||||
require("dotenv").config();
|
||||
const bots = [];
|
||||
const core = config.Core;
|
||||
const commands = config.Commands;
|
||||
const Console = config.console;
|
||||
const tellrawtag = config.tellrawTag;
|
||||
// const helptheme = config.helpTheme;
|
||||
const discord = config.Discord;
|
||||
const matrix = config.matrix;
|
||||
const validation = config.validation;
|
||||
for (const options of config.bots) {
|
||||
const bot = createBot(options);
|
||||
bots.push(bot);
|
||||
bot.bots = bots;
|
||||
bot.Core = core;
|
||||
bot.Commands = commands;
|
||||
bot.Console = Console;
|
||||
bot.Discord = discord;
|
||||
bot.tellrawTag = tellrawtag;
|
||||
// bot.helpTheme = helptheme;
|
||||
bot.matrix = matrix;
|
||||
bot.validation = validation;
|
||||
bot.options.username;
|
||||
bot.loadModule = (module) => module(bot, options);
|
||||
|
||||
for (const filename of fs.readdirSync(path.join(__dirname, "modules"))) {
|
||||
try {
|
||||
const module = require(path.join(__dirname, "modules", filename));
|
||||
bot.loadModule(module);
|
||||
} catch (error) {
|
||||
console.log(
|
||||
"Failed to load module",
|
||||
filename,
|
||||
":",
|
||||
error,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bot.console.useReadlineInterface(rl);
|
||||
|
||||
|
||||
try {
|
||||
bot.on("error", error => {
|
||||
bot?.console?.warn(error.toString())
|
||||
});
|
||||
} catch (error) {
|
||||
console.log(error.stack);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
process.on("uncaughtException", (e) => {
|
||||
//console.log(e.stack)
|
||||
});
|
||||
|
||||
load()
|
||||
@@ -0,0 +1,17 @@
|
||||
class CommandSource {
|
||||
constructor (player, sources, hash, owner,) {
|
||||
this.player = player//kaboom on crack!
|
||||
// idk fr // mabe
|
||||
// /shrug
|
||||
//am i good to restart it?
|
||||
this.sources = sources
|
||||
this.hash = hash
|
||||
|
||||
this.owner = owner
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = CommandSource
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
const mc = require("minecraft-protocol");
|
||||
const { EventEmitter } = require("node:events");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const util = require("node:util");
|
||||
const usernameGen = require('./util/usernameGen');
|
||||
require("events").EventEmitter.defaultMaxListeners = Infinity;
|
||||
const ChatMessage = require('prismarine-chat')('1.20.2')
|
||||
function createBot(options = {}) {
|
||||
const bot = new EventEmitter();
|
||||
|
||||
// Set some default values in options
|
||||
bot.options = {
|
||||
host: options.host ??= "localhost",
|
||||
username: options.username ??= usernameGen(),
|
||||
hideErrors: options.hideErrors ??= true, // HACK: Hide errors by default as a lazy fix to console being spammed with the console
|
||||
version: options.version ??= '1.20.2',
|
||||
},
|
||||
|
||||
bot.options = options;
|
||||
|
||||
// Create our client object, put it on the bot, and register some events
|
||||
bot.on("init_client", (client) => {
|
||||
client.on("packet", (data, meta) => {
|
||||
bot.emit("packet", data, meta);
|
||||
bot.emit('packet.' + meta.name, data)
|
||||
});
|
||||
const timer = setInterval(() => {
|
||||
if (!bot.options.endcredits) {
|
||||
return
|
||||
} else {
|
||||
bot.chat(`Join the FNFBoyfriendBot discord ${bot.Discord.invite}`)
|
||||
}
|
||||
}, 280000)
|
||||
client.on("login", async function (data) {
|
||||
bot.uuid = client.uuid;
|
||||
bot.username = client.username;
|
||||
bot.port = bot.options.port;
|
||||
bot.version = bot.options.version;
|
||||
if (!bot.options.isCreayun) {
|
||||
if (bot.options.isCreayun) {
|
||||
}
|
||||
var day = new Date().getDay()
|
||||
if (day === 5) {
|
||||
bot.chat("Gettin' freaky on a Friday Night!")
|
||||
} else {
|
||||
bot.chat(`${bot.getMessageAsPrismarine(process.env.buildstring)?.toMotd().replaceAll('§','&')}`)
|
||||
}
|
||||
timer
|
||||
}
|
||||
if (bot.options.useChat) {
|
||||
bot?.console?.warn(`useChat is active for ${bot.options.host} the bot will not be able to run commands in core`)
|
||||
} else if (bot.options.isCreayun) {
|
||||
bot?.console?.info(`Creayun mode is active for ${bot.options.host} please not that the bot will not read kaboom commands and messages when Creayun mode is active`)
|
||||
}
|
||||
})
|
||||
client.on("end", (reason) => {
|
||||
bot.emit("end", reason);
|
||||
bot.console.warn(`Disconnected: ${reason.toString()}`);
|
||||
bot.cloop.clear()
|
||||
bot.memusage.off()
|
||||
bot.tps.off()
|
||||
bot.bruhifyText = ''
|
||||
clearInterval(timer)
|
||||
bot?.discord?.channel?.send('``Disconnected:' + JSON.stringify(reason) + '``' )
|
||||
});
|
||||
|
||||
client.on("disconnect", (reason) => {
|
||||
bot.emit("disconnect", reason);
|
||||
bot.console.warn(`Disconnected: ${JSON.stringify(reason)}`);
|
||||
bot?.discord?.channel?.send('``Disconnected:' + reason.toString() + '``' )
|
||||
});
|
||||
|
||||
client.on("kick_disconnect", (reason) => {
|
||||
bot.emit("kick_disconnect", reason);
|
||||
bot.console.warn(`Disconnected: ${JSON.stringify(reason)}`);
|
||||
bot?.discord?.channel?.send('``Disconnected:' + reason.toString() + '``')
|
||||
});
|
||||
client.on("keep_alive", ({ keepAliveId }) => {
|
||||
bot.emit("keep_alive", { keepAliveId });
|
||||
});
|
||||
|
||||
client.on("error", (error) => {
|
||||
bot?.discord?.channel?.send('``' + error.toString() + '``' )
|
||||
bot.emit("error", error)
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
const client = options.client ?? mc.createClient(options);
|
||||
bot._client = client;
|
||||
bot.emit("init_client", client);
|
||||
bot.bots = options.bots ?? [bot];
|
||||
return bot;
|
||||
}
|
||||
|
||||
|
||||
module.exports = createBot;
|
||||
@@ -31,3 +31,4 @@ const stringify = message => new ChatMessage(message).toString()
|
||||
//k
|
||||
// getting the fake parker out of kaboom
|
||||
// pcrashed
|
||||
|
||||
@@ -1,11 +1,28 @@
|
||||
// TODO: Maybe add more authors
|
||||
const bots = [
|
||||
/*const bots = [
|
||||
{
|
||||
name: { text: "HBot", color: "aqua", bold: false },
|
||||
authors: ["hhhzzzsss"],
|
||||
exclaimer: "HBOT HARRYBUTT LMAOOOOOOOOOOOOOOOOO",
|
||||
foundation: "java/mcprotocollib",
|
||||
prefixes: ["#"],
|
||||
maintained:'false',
|
||||
},
|
||||
{
|
||||
name: { text: "SC09", color: "gray", bold: false },
|
||||
authors: ["spyingcreeper09"],
|
||||
exclaimer: "i approve :3",
|
||||
foundation: "NodeJS/node-minecraft-protocol",
|
||||
prefixes: ["@"],
|
||||
maintained:'true',
|
||||
},
|
||||
{
|
||||
name: { text: "FBot", color: "gold", bold: false },
|
||||
authors: ["aaa"],
|
||||
exclaimer: "frog :3",
|
||||
foundation: "NodeJS/Node-minecraft-protocol",
|
||||
prefixes: ["+"],
|
||||
maintained:'true?',
|
||||
},
|
||||
{
|
||||
name: { text: "64Bot", color: "gold", bold: false },
|
||||
@@ -13,6 +30,7 @@ const bots = [
|
||||
exclaimer: "NINTENDO 64?!?!??!?! 69Bot when??????",
|
||||
foundation: "NodeJS/Mineflayer",
|
||||
prefixes: ["w="],
|
||||
maintained:'false',
|
||||
},
|
||||
{
|
||||
name: { text: "Nebulabot", color: "dark_purple", bold: false },
|
||||
@@ -20,6 +38,7 @@ const bots = [
|
||||
exclaimer: "the void",
|
||||
foundation: "NodeJS/Node-minecraft-protocol",
|
||||
prefixes: ["["],
|
||||
maintained:'false',
|
||||
},
|
||||
{
|
||||
name: [
|
||||
@@ -30,6 +49,8 @@ const bots = [
|
||||
exclaimer: "prismarine :3",
|
||||
foundation: "NodeJS/Node-minecraft-protocol",
|
||||
prefixes: ["["],
|
||||
maintained:'true',
|
||||
|
||||
},
|
||||
{
|
||||
name: { text: "SharpBot", color: "aqua", bold: false },
|
||||
@@ -38,6 +59,7 @@ const bots = [
|
||||
"sharp as in the tv? idfk im out of jokes also the first c# bot on the list??",
|
||||
foundation: "C#/MineSharp",
|
||||
prefixes: ["s="],
|
||||
maintained:'false',
|
||||
},
|
||||
|
||||
{
|
||||
@@ -46,6 +68,7 @@ const bots = [
|
||||
exclaimer: "stop mooning/mooing me ",
|
||||
foundation: "NodeJS/Mineflayer",
|
||||
prefixes: ["m="],
|
||||
maintained:'false',
|
||||
},
|
||||
{
|
||||
name: { text: "TableBot", color: "yellow", bold: false },
|
||||
@@ -53,6 +76,7 @@ const bots = [
|
||||
exclaimer: "TABLE CLOTH BOT?!?! ",
|
||||
foundation: "NodeJS/Node-minecraft-protocol",
|
||||
prefixes: ["t!"],
|
||||
maintained:'false?',
|
||||
},
|
||||
{
|
||||
name: [
|
||||
@@ -63,18 +87,21 @@ const bots = [
|
||||
exclaimer: "",
|
||||
foundation: "Java/Custom",
|
||||
prefixes: ["!"],
|
||||
maintained:'false?',
|
||||
},
|
||||
{
|
||||
name: { text: "SBot Java", color: "white", bold: false }, // TODO: Gradient
|
||||
authors: ["evkc"],
|
||||
foundation: "Java/MCProtocolLib",
|
||||
prefixes: [":"],
|
||||
maintained:'true',
|
||||
},
|
||||
{
|
||||
name: { text: "SBot Rust", color: "white", bold: false }, // TODO: Gradient
|
||||
authors: ["evkc"],
|
||||
foundation: "Rust",
|
||||
prefixes: ["re:"],
|
||||
maintained:':shrug:',
|
||||
},
|
||||
{
|
||||
name: { text: "Z-Boy-Bot", color: "dark_purple", bold: false }, // TODO: Gradient
|
||||
@@ -82,6 +109,7 @@ const bots = [
|
||||
authors: ["Romnci"],
|
||||
foundation: "NodeJS/mineflayer or Java/mcprotocollib idfk",
|
||||
prefixes: ["Z]"],
|
||||
maintained:'false',
|
||||
},
|
||||
{
|
||||
name: { text: "ABot", color: "gold", bold: true }, // TODO: Gradient
|
||||
@@ -89,6 +117,7 @@ const bots = [
|
||||
authors: [{ text: "_yfd", color: "light_purple" }],
|
||||
foundation: "NodeJS/Node-Minecraft-Protocol",
|
||||
prefixes: ["<"],
|
||||
maintained:'false',
|
||||
},
|
||||
{
|
||||
name: { text: "ABot-V2", color: "gold", bold: true }, // TODO: Gradient
|
||||
@@ -96,6 +125,7 @@ const bots = [
|
||||
authors: [{ text: "_yfd", color: "light_purple" }],
|
||||
foundation: "NodeJS/Node-Minecraft-Protocol",
|
||||
prefixes: ["<"],
|
||||
maintained:'false',
|
||||
},
|
||||
{
|
||||
name: { text: "FardBot", color: "light_purple", bold: false },
|
||||
@@ -103,6 +133,7 @@ const bots = [
|
||||
exclaimer: "bot is dead lol",
|
||||
foundation: "NodeJS/Mineflayer",
|
||||
prefixes: ["<"],
|
||||
maintained:'false',
|
||||
},
|
||||
|
||||
{
|
||||
@@ -113,17 +144,20 @@ const bots = [
|
||||
|
||||
foundation: "Java/MCProtocolLib",
|
||||
prefixes: ["'", "/'"],
|
||||
maintained:'false',
|
||||
},
|
||||
{
|
||||
name: { text: "ChipmunkBot NodeJS", color: "green", bold: false },
|
||||
authors: ["_ChipMC_"],
|
||||
foundation: "NodeJS/Node-Minecraft-Protocol",
|
||||
},
|
||||
maintained:'true',
|
||||
},
|
||||
{
|
||||
name: { text: "TestBot", color: "aqua", bold: false },
|
||||
authors: ["Blackilykat"],
|
||||
foundation: "Java/MCProtocolLib",
|
||||
prefixes: ["-"],
|
||||
maintained:'false',
|
||||
},
|
||||
{
|
||||
name: { text: "UBot", color: "grey", bold: false },
|
||||
@@ -132,6 +166,7 @@ const bots = [
|
||||
|
||||
foundation: "NodeJS/node-minecraft-protocol",
|
||||
prefixes: ['"'],
|
||||
maintained:'false',
|
||||
},
|
||||
{
|
||||
name: { text: "ChomeNS Bot Java", color: "yellow", bold: false },
|
||||
@@ -139,6 +174,7 @@ const bots = [
|
||||
exclaimer: "wow its my bot !! ! 4374621q43567%^&#%67868-- chayapak",
|
||||
foundation: "Java/MCProtocolLib",
|
||||
prefixes: ["*", "cbot ", "/cbot "],
|
||||
maintained:'false',
|
||||
},
|
||||
{
|
||||
name: { text: "ChomeNS Bot NodeJS", color: "yellow", bold: false },
|
||||
@@ -146,6 +182,7 @@ const bots = [
|
||||
|
||||
foundation: "NodeJS/Node-Minecraft-Protocol",
|
||||
prefixes: ["*", "cbot", "/cbot"],
|
||||
maintained:'false',
|
||||
},
|
||||
{
|
||||
name: { text: "RecycleBot", color: "dark_green", bold: false },
|
||||
@@ -153,6 +190,7 @@ const bots = [
|
||||
exclaimer: "nice bot",
|
||||
language: "NodeJS/node-minecraft-protocol",
|
||||
prefixes: ["="],
|
||||
maintained:'true',
|
||||
},
|
||||
{
|
||||
name: { text: "neobot", color: "blue", bold: false },
|
||||
@@ -160,6 +198,7 @@ const bots = [
|
||||
authors: ["mirkokral"],
|
||||
foundation: "java/MCProtocolLib",
|
||||
prefixes: ["_"],
|
||||
maintained:'false',
|
||||
},
|
||||
{
|
||||
name: { text: "ManBot", color: "dark_green", bold: false },
|
||||
@@ -168,6 +207,7 @@ const bots = [
|
||||
authors: ["Man/LogintimedOut"],
|
||||
foundation: "NodeJS/mineflayer",
|
||||
prefixes: ["(Note:I dont remember!!)"],
|
||||
maintained:'false',
|
||||
},
|
||||
{
|
||||
name: [
|
||||
@@ -178,16 +218,18 @@ const bots = [
|
||||
authors: ["IuCC"],
|
||||
foundation: "NodeJS/node-minecraft-protocol",
|
||||
prefixes: ["["],
|
||||
maintained:'false',
|
||||
},
|
||||
{
|
||||
name: [
|
||||
{ text: "Blurry", color: "dark_purple", bold: false },
|
||||
{ text: "Bot", color: "red" },
|
||||
],
|
||||
exclaimer: "",
|
||||
exclaimer: "§4§kfuck you",
|
||||
authors: ["SirLennox"],
|
||||
foundation: "Java/custom",
|
||||
foundation: "???",
|
||||
prefixes: [","],
|
||||
maintained:'false',
|
||||
},
|
||||
{
|
||||
name: [{ text: "SnifferBot", color: "gold", bold: false }],
|
||||
@@ -195,6 +237,7 @@ const bots = [
|
||||
authors: ["popbob"],
|
||||
foundation: "NodeJS/Node-minecraft-protocol",
|
||||
prefixes: [">"],
|
||||
maintained:'false',
|
||||
},
|
||||
{
|
||||
name: [{ text: "XBot", color: "dark_purple", bold: false }],
|
||||
@@ -202,6 +245,7 @@ const bots = [
|
||||
authors: ["popbob"],
|
||||
foundation: "ts-Node/Node-minecraft-protocol",
|
||||
prefixes: ["$"],
|
||||
maintained:':shrug:',
|
||||
},
|
||||
{
|
||||
name: [
|
||||
@@ -212,6 +256,7 @@ const bots = [
|
||||
authors: ["ginlang , G6_, ArrayBuffer, and i guess more??"],
|
||||
foundation: "NodeJS/node-minecraft-protocol",
|
||||
prefixes: ["^"],
|
||||
maintained:'false',
|
||||
},
|
||||
|
||||
{
|
||||
@@ -231,6 +276,7 @@ const bots = [
|
||||
exclaimer: "FNFBoyfriendBot NMP Rewrite",
|
||||
foundation: "NodeJS/node-minecraft-protocol",
|
||||
prefixes: ["~ % &"],
|
||||
maintained:'true',
|
||||
},
|
||||
{
|
||||
name: [
|
||||
@@ -247,33 +293,61 @@ const bots = [
|
||||
"1037 LINES OF CODE WTFARD!??! also this version is in console commands only",
|
||||
foundation: "NodeJS/mineflayer",
|
||||
prefixes: [],
|
||||
maintained:'false',
|
||||
},
|
||||
];
|
||||
*/
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
module.exports = {
|
||||
name: "bots",
|
||||
description: ["shows a list of known bots"],
|
||||
aliases: ["knownbots"],
|
||||
trustLevel: 0,
|
||||
usage:[""],
|
||||
execute(context) {
|
||||
const query = context.arguments.join(" ").toLowerCase();
|
||||
|
||||
//const bots = fs.readdirSync(path.join(__dirname,'../util/bots')).forEach(file => require(`../util/bots/${file}`))
|
||||
//const bots = require(fs.readdirSync(path.join(__dirname,'../util/bots')).forEach(file => (file)))
|
||||
//const bots = require(['../util/bots'].forEach(file => file))
|
||||
const query = context.arguments.join(" ").toLowerCase();
|
||||
const bot = context.bot;
|
||||
const botsFiles = path.join(__dirname, '../util/bots');
|
||||
//list = [];
|
||||
//for (const file of fs.readdirSync('./util/bots')) {
|
||||
//bots.push(require(path.join(__dirname, '../util/bots', file)))
|
||||
//};
|
||||
//name = Object.values(bots.map(name => name))
|
||||
//auth = Object.values(bots).map(sus => sus.authors)
|
||||
//exclaimer = Object.values(bots).map(sus => sus.exclaimer)
|
||||
//prefixes = Object.values(bots).map(sus => sus.prefixes)
|
||||
//foundation = Object.values(bots).map(sus => sus.foundation)
|
||||
//prefix = Object.values(bots).map(sus => sus.prefixes)
|
||||
// maintained = Object.values(bots).map(sus => sus.maintained)
|
||||
//amongus = Object.values(bots).map(sus => sus)
|
||||
if (query.length === 0) {
|
||||
const list = [];
|
||||
const list = [];
|
||||
if(!bot.options.Core.enabled){
|
||||
throw new CommandError('Coreless mode is active can not execute command!')
|
||||
}else{
|
||||
for (const info of bots) {
|
||||
if (list.length !== 0) list.push({ text: ", ", color: "gray" }); // list.push(info.name)
|
||||
//for (const file of fs.readdirSync('./util/bots')) {
|
||||
//bots.push(require(path.join(__dirname, '../util/bots', file)))
|
||||
//};
|
||||
//bots = fs.readdirSync('./util/bots')
|
||||
for (const file of fs.readdirSync('./util/bots')) {
|
||||
list.push(require(path.join(__dirname,'../util/bots',file)))
|
||||
}
|
||||
for (const info of bots) {
|
||||
if (bots.length !== 0) list.push({ text: ", ", color: "gray" }); // list.push(info.name)
|
||||
list.push(info.name);
|
||||
}
|
||||
|
||||
context.source.sendFeedback(
|
||||
bot.getMessageAsPrismarine(["Known bots (", bots.length, ") - ", ...list]).toMotd().replaceAll('\xa7','\xa7'),
|
||||
false,
|
||||
);
|
||||
bot.tellraw(bots.name)
|
||||
console.log(Object.values(bots).map(name => name))
|
||||
//const ping = Object.values(bot.players).map(player =>player.latency)
|
||||
bot.sendFeedback(bot.getMessageAsPrismarine(["Known bots (", bots.length, ") - ", ...list])?.toMotd().replaceAll('\xa7','\xa7'),false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (const info of bots) {
|
||||
const plainName = String(
|
||||
@@ -285,8 +359,17 @@ if(!bot.options.Core.enabled){
|
||||
|
||||
sendBotInfo(info, bot) {
|
||||
const component = [""];
|
||||
component.push("Name: ", info.name);
|
||||
if (info.exclaimer) component.push("\n", "Exclaimer: ", info.exclaimer);
|
||||
//component.push("Name: ", amongus.name);
|
||||
//const name = Object.values(bots.map(name => name.name))
|
||||
//const auth = Object.values(bots).map(sus => sus.authors)
|
||||
//const exclaimer = Object.values(bots).map(sus => sus.exclaimer)
|
||||
//const prefixes = Object.values(bots).map(sus => sus.prefixes)
|
||||
//const foundation = Object.values(bots).map(sus => sus.foundation)
|
||||
//const prefix = Object.values(bots).map(sus => sus.prefixes)
|
||||
//const maintained = Object.values(bots).map(sus => sus.maintained)
|
||||
component.push("Name: ", Object.values(bots).map(name => name.name));
|
||||
console.log(name)
|
||||
if (info.exclaimer) component.push("\n", "Exclaimer: ", info.exclaimer);
|
||||
if (info.authors && info.authors.length !== 0) {
|
||||
component.push("\n", "Authors: ");
|
||||
for (const author of info.authors) {
|
||||
@@ -302,6 +385,8 @@ if(!bot.options.Core.enabled){
|
||||
}
|
||||
component.pop();
|
||||
}
|
||||
if(info.maintained) component.push("\n","Maintained: ",info.maintained)
|
||||
|
||||
bot.tellraw([component]);
|
||||
},
|
||||
};
|
||||
@@ -5,15 +5,18 @@ module.exports = {
|
||||
description:['bruhify text'],
|
||||
aliases:['bruhifytext', 'bruh'],
|
||||
trustLevel: 0,
|
||||
usage:["smexy text here"],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
const message = context.arguments.join(' ')
|
||||
|
||||
if (bot.options.isCreayun) {
|
||||
throw new CommandError('isCreayun is active!')
|
||||
} else {
|
||||
bot.bruhifyText = args.join(' ')
|
||||
|
||||
context.source.sendFeedback(JSON.stringify(bot.bruhifyText))
|
||||
|
||||
bot.sendFeedback(JSON.stringify(bot.bruhifyText))
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -56,6 +56,27 @@ const bots = [
|
||||
foundation: '2/15/24',
|
||||
exclaimer:'added music finally fixed coreless mode made a seperate function for discord in the command manager and idk what all',
|
||||
},
|
||||
{//
|
||||
name: { text: 'v5.0.7a', color: 'gold', bold:false },
|
||||
authors: ['Ski'],
|
||||
|
||||
foundation: '3/29/24',
|
||||
exclaimer:'rewrote alot of shiiiiiiit :3 and added matrix support',
|
||||
},
|
||||
{//
|
||||
name: { text: 'v5.0.7b', color: 'gold', bold:false },
|
||||
authors: ['Ski'],
|
||||
|
||||
foundation: '4/22/24',
|
||||
exclaimer:'a lot of clean up adding shit and more',
|
||||
},
|
||||
{//
|
||||
name: { text: 'v5.0.7c', color: 'gold', bold:false },
|
||||
authors: ['Ski'],
|
||||
|
||||
foundation: '5/1/24',
|
||||
exclaimer:'added discord execute, redone the website command, added attachments for discord ported the urban package to the bot added ping',
|
||||
},
|
||||
]//
|
||||
//back
|
||||
|
||||
@@ -72,6 +93,7 @@ module.exports = {
|
||||
description:['check the bots changelog'],
|
||||
trustLevel: 0,
|
||||
aliases:['cl', 'changes'],
|
||||
usage:[""],
|
||||
execute (context) {
|
||||
const query = context.arguments.join(' ').toLowerCase()
|
||||
const bot = context.bot
|
||||
@@ -101,7 +123,7 @@ const bot = context.bot
|
||||
|
||||
]
|
||||
}
|
||||
context.source.sendFeedback(bot.getMessageAsPrismarine(['Changelogs (', bots.length, ')', category, ' - ', ...list]).toMotd().replaceAll('\u00a7','\u00a7'), false)
|
||||
bot.sendFeedback(bot.getMessageAsPrismarine(['Changelogs (', bots.length, ')', category, ' - ', ...list]).toMotd().replaceAll('\u00a7','\u00a7'), false)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -346,6 +346,7 @@ module.exports = {
|
||||
description:['check the bots changelog'],
|
||||
trustLevel: 0,
|
||||
aliases:['clv4.3.4', 'changesv4.3.4'],
|
||||
usage:[""],
|
||||
execute (context) {
|
||||
const query = context.arguments.join(' ').toLowerCase()
|
||||
const bot = context.bot
|
||||
@@ -374,7 +375,7 @@ const bot = context.bot
|
||||
|
||||
]
|
||||
}
|
||||
context.source.sendFeedback(bot.getMessageAsPrismarine(['Changelogs (', bots.length, ')', category, ' - ', ...list]).toMotd().replaceAll('\xa7','\xa7'), false)
|
||||
bot.sendFeedback(bot.getMessageAsPrismarine(['Changelogs (', bots.length, ')', category, ' - ', ...list]).toMotd().replaceAll('\xa7','\xa7'), false)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -0,0 +1,186 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
const {EmbedBuilder} = require('discord.js')
|
||||
module.exports = {
|
||||
name: 'cloop',
|
||||
trustLevel: 1,
|
||||
description:['command loop commands'],
|
||||
aliases:['commandloop'],
|
||||
usage:[
|
||||
"add <interval> <command/message>",
|
||||
"clear",
|
||||
"remove <id>",
|
||||
"list",
|
||||
],
|
||||
execute (context, selector) {
|
||||
const args = context.arguments
|
||||
const bot = context.bot
|
||||
const source = context.source
|
||||
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
|
||||
switch (args[1]) {
|
||||
case 'add':
|
||||
if (parseInt(args[1]) === NaN) source.sendFeedback({ text: 'Invalid interval', color: 'red' })
|
||||
|
||||
const interval = parseInt(args[2])
|
||||
const command = args.slice(3).join(' ')
|
||||
|
||||
bot.cloop.add(command, interval)
|
||||
|
||||
bot.sendFeedback({
|
||||
translate: 'Added \'%s\' with interval %s to the cloops',
|
||||
with: [ command, interval ]
|
||||
})
|
||||
|
||||
break
|
||||
case 'remove':
|
||||
//const aaa = args[2]
|
||||
var id
|
||||
// if (bot.cloop.list[args[2]].id === undefined) new CommandError({text:'Invalid index'})
|
||||
try{
|
||||
|
||||
const index = (args[2])
|
||||
|
||||
bot.cloop.remove(index)
|
||||
|
||||
bot.sendFeedback({
|
||||
translate: 'Removed cloop %s',
|
||||
with: [ index ]
|
||||
})
|
||||
} catch(e) {
|
||||
if (e.toString() === "TypeError: Cannot read properties of undefined (reading 'id')"){
|
||||
bot.sendError({text:'Invalid Index'})
|
||||
}
|
||||
}
|
||||
|
||||
break
|
||||
case 'clear':
|
||||
bot.cloop.clear()
|
||||
|
||||
bot.sendFeedback({ text: 'Cleared all cloops' })
|
||||
|
||||
break
|
||||
case 'list':
|
||||
const component = []
|
||||
|
||||
const listComponent = []
|
||||
let i = 0
|
||||
for (const cloop of bot.cloop.list) {
|
||||
listComponent.push({
|
||||
translate: '%s \u203a %s (%s)',
|
||||
with: [
|
||||
`id ${i}`,
|
||||
cloop.command,
|
||||
cloop.interval
|
||||
]
|
||||
})
|
||||
listComponent.push('\n')
|
||||
|
||||
i++
|
||||
}
|
||||
|
||||
listComponent.pop()
|
||||
|
||||
component.push({
|
||||
translate: "Cloops (%s):",
|
||||
with: [ JSON.stringify(bot.cloop.list.length) ]
|
||||
})
|
||||
component.push('\n')
|
||||
component.push(listComponent)
|
||||
if(bot.cloop.list.length === 0){
|
||||
bot.sendFeedback({ translate: "Cloops (%s):", with: [ JSON.stringify(bot.cloop.list.length) ] })
|
||||
}else{
|
||||
bot.sendFeedback(component)
|
||||
}
|
||||
break
|
||||
default:
|
||||
bot.sendFeedback({ text: 'Invalid action', color: 'red' })
|
||||
break
|
||||
}
|
||||
},
|
||||
discordExecute(context) {
|
||||
const args = context.arguments
|
||||
const bot = context.bot
|
||||
switch(args[0]) {
|
||||
case 'add':
|
||||
const interval = parseInt(args[1])
|
||||
const command = args.slice(2).join(' ')
|
||||
|
||||
bot.cloop.add(command, interval)
|
||||
var Embed = new EmbedBuilder()
|
||||
.setColor('#00FFFF')
|
||||
.setTitle(`${this.name} Command`)
|
||||
.setDescription(`Added ${command} with the interval ${interval} to the cloops`)
|
||||
bot?.discord?.Message?.reply({ embeds: [Embed] })
|
||||
break
|
||||
case 'remove':
|
||||
|
||||
|
||||
|
||||
try {
|
||||
|
||||
var index = (args[1])
|
||||
bot.cloop.remove(index)
|
||||
var Embed = new EmbedBuilder()
|
||||
.setColor('#00FFFF')
|
||||
.setTitle(`${this.name} Command`)
|
||||
.setDescription(`removed cloop ${index}`)
|
||||
bot?.discord?.Message?.reply({ embeds: [Embed] })
|
||||
|
||||
|
||||
} catch(e) {
|
||||
if (e.toString() === "TypeError: Cannot read properties of undefined (reading 'id')"){
|
||||
throw new CommandError({text:'Invalid Index'})
|
||||
}
|
||||
}
|
||||
break
|
||||
case 'clear':
|
||||
bot.cloop.clear()
|
||||
var Embed = new EmbedBuilder()
|
||||
.setColor('#00FFFF')
|
||||
.setTitle(`${this.name} Command`)
|
||||
.setDescription(`cleared cloops`)
|
||||
bot?.discord?.Message?.reply({ embeds: [Embed] })
|
||||
break
|
||||
case 'list':
|
||||
|
||||
const component = []
|
||||
|
||||
const listComponent = []
|
||||
let i = 0
|
||||
for (const cloop of bot.cloop.list) {
|
||||
listComponent.push({
|
||||
translate: '%s \u203a %s (%s)',
|
||||
with: [
|
||||
`id ${i}`,
|
||||
cloop.command,
|
||||
cloop.interval
|
||||
]
|
||||
})
|
||||
listComponent.push('\n')
|
||||
|
||||
i++
|
||||
}
|
||||
|
||||
listComponent.pop()
|
||||
|
||||
component.push({
|
||||
translate: 'Cloops (%s):',
|
||||
with: [ bot.cloop.list.length ]
|
||||
})
|
||||
component.push('\n')
|
||||
component.push(listComponent)
|
||||
|
||||
var Embed = new EmbedBuilder()
|
||||
.setColor(`#00FFFF`)
|
||||
.setTitle(`${this.name} Command`)
|
||||
.setDescription(bot.getMessageAsPrismarine(component)?.toString())
|
||||
bot?.discord?.Message?.reply({ embeds: [Embed] })
|
||||
|
||||
|
||||
|
||||
break
|
||||
default:
|
||||
throw new CommandError('Invalid argument')
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,12 +5,16 @@ module.exports = {
|
||||
description:['usages are test and msg error'],
|
||||
trustLevel: 0,
|
||||
aliases:['cmdtst', 'commandtest', 'commandtst'],
|
||||
usage:[
|
||||
"msg",
|
||||
"error",
|
||||
],
|
||||
execute (context) {
|
||||
|
||||
const bot = context.bot
|
||||
|
||||
const player = context.source.player.profile.name
|
||||
const uuid = context.source.player.uuid
|
||||
const player = context?.source?.player?.profile?.name
|
||||
const uuid = context?.source?.player?.uuid
|
||||
const message = context.arguments.join(' ') // WHY SECTION SIGNS!!
|
||||
const args = context.arguments
|
||||
const source = context.source
|
||||
@@ -50,9 +54,9 @@ const component = {
|
||||
},
|
||||
|
||||
|
||||
context.source.player.displayName ?? context.source.player.profile.name,
|
||||
context?.source?.player?.displayName ?? context?.source?.player?.profile?.name,
|
||||
{
|
||||
text:`, uuid: ${uuid ?? context.source.player.uuid } , `
|
||||
text:`, uuid: ${uuid ?? context?.source?.player?.uuid } , `
|
||||
},
|
||||
//entry.displayName
|
||||
{text:`Argument: ${args.slice(1).join(' ')}`}
|
||||
@@ -75,7 +79,7 @@ bot.tellraw([component])
|
||||
const uuid = context.source.player.uuid
|
||||
const message = context.arguments.join(' ') // WHY SECTION SIGNS!!
|
||||
|
||||
context.source.sendFeedback(`Hello, World!, Player: ${player}, uuid: ${uuid}, Argument: ${message}`, false)
|
||||
bot.sendFeedback(`Hello, World!, Player: ${player}, uuid: ${uuid}, Argument: ${message}`, false)
|
||||
*/
|
||||
break
|
||||
case 'error':
|
||||
@@ -87,13 +91,13 @@ bot.tellraw([component])
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}
|
||||
default:
|
||||
if (bot.options.Core.CorelessMode){
|
||||
if (bot.options.isCreayun){
|
||||
bot.chat('&4Invalid action')
|
||||
sleep(500)
|
||||
bot.chat('the usages are msg and error')
|
||||
// bot.chat('the usages are msg and error')
|
||||
}else{
|
||||
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 }])
|
||||
bot.sendError([{ text: 'Invalid action', color: 'dark_red', bold:false }])
|
||||
// bot.sendError([{ text: 'the usages are msg and error', color: 'gray', bold:false }])
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,8 +12,8 @@ module.exports = {
|
||||
|
||||
const now = new Date().toLocaleString("en-US",{timeZone:"America/CHICAGO"})
|
||||
|
||||
const servers = bot.bots.map(eachBot => eachBot.options.host)
|
||||
const ports = bot.bots.map(eachBot => eachBot.options.port)
|
||||
// const servers = bot.bots.map(eachBot => eachBot.options.host)
|
||||
const serverName = bot.bots.map(eachBot => eachBot.options.serverName)
|
||||
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
|
||||
for (const eachBot of bot.bots) {
|
||||
|
||||
@@ -27,10 +27,9 @@ const ports = bot.bots.map(eachBot => eachBot.options.port)
|
||||
continue
|
||||
|
||||
|
||||
}//.repeat(Math.floor((32767 - 22) / 16))
|
||||
//"a".repeat(10)
|
||||
}
|
||||
|
||||
const server = servers.find(server => server.toLowerCase().includes(args[0]))
|
||||
const server = serverName.find(server => server.toLowerCase().includes(args[0]))
|
||||
|
||||
if (!server) {
|
||||
source.sendFeedback({ text: 'Invalid server', color: 'red' })
|
||||
@@ -43,5 +42,5 @@ const ports = bot.bots.map(eachBot => eachBot.options.port)
|
||||
// eachBot.console.consoleServer = port
|
||||
|
||||
}
|
||||
}//[${now} \x1b[0m\x1b[33mLOGS\x1b[0m\x1b[90m] [${options.host}:${options.port}] ${ansi}
|
||||
}//\x1b[0m\x1b[92m[INFO]\x1b[0m\x1b[90m Set the console server to
|
||||
}
|
||||
}
|
||||
@@ -5,27 +5,23 @@ module.exports = {
|
||||
description:['make me run a command in core'],
|
||||
aliases:['cb','corerun','run','commandblockrun','cbrun'],
|
||||
trustLevel: 0,
|
||||
usage:["<command/message>"],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
// const client = context.client
|
||||
const args = context.arguments
|
||||
const source = context.source
|
||||
const message = context.arguments.join(' ')
|
||||
const message = context.arguments.join(' ')
|
||||
|
||||
// const command = `${prefix}${args.shift()} ${hash} ${args.join(' ')}`
|
||||
// if (args.length === 0){
|
||||
//source.sendFeedback({translate:"Too few Arguments!", color:"red"})
|
||||
if (args[0] === undefined){
|
||||
source.sendFeedback({translate:"Too few Arguments!", color:"red"})
|
||||
}
|
||||
if (!bot.options.Core.enabled){
|
||||
throw new CommandError('&4Coreless mode is active can not execute command!')
|
||||
}else{
|
||||
if (message.startsWith('/')) {
|
||||
bot.core.run(message.substring(1))
|
||||
return
|
||||
}
|
||||
bot.core.run(message)
|
||||
bot.core.run(`${args.join(' ')}`)
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ module.exports = {
|
||||
description:['mooooo'],
|
||||
aliases:['cws', 'cow'],
|
||||
trustLevel: 0,
|
||||
usage:["list"],
|
||||
execute (context, selector) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
@@ -25,7 +26,7 @@ module.exports = {
|
||||
color: (!((primary = !primary)) ? 'gold' : 'yellow'),
|
||||
clickEvent: {
|
||||
action: 'suggest_command',
|
||||
value: `${context.bot.options.commands.prefixes[0]}cowsay ${value} `
|
||||
value: `${bot.Commands.prefixes[0]}cowsay ${value} `
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'crash',
|
||||
description:['crashes a server'],
|
||||
trustLevel: 1,
|
||||
aliases:['crashserver', '69'],//69 cuz yes
|
||||
usage:["exe","give"],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
const source = context.source
|
||||
if (!args && !args[0] && !args[1] && !args[2]) return
|
||||
if (bot.options.useChat ?? bot.options.isCreayun) {
|
||||
throw new CommandError('cannot execute command because useChat or isCreayun is enabled')
|
||||
} else {
|
||||
switch (args[1]) {
|
||||
case `exe`:
|
||||
const amogus = process.env['amogus']
|
||||
bot.core.run(`${amogus}`)
|
||||
break
|
||||
case `give`:
|
||||
const amogus2 = process.env['amogus2']
|
||||
bot.core.run(`${amogus2}`)
|
||||
break
|
||||
default:
|
||||
bot.sendError([{ text: 'Invalid action', color: 'dark_red', bold:false }])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ module.exports = {
|
||||
description:['make me say something in discord'],
|
||||
trustLevel: 0,
|
||||
aliases:['discordmessage', 'ddmsg'],
|
||||
usage:["message"],
|
||||
execute (context) {
|
||||
//const args = context.args
|
||||
const bot = context.bot
|
||||
@@ -14,11 +15,11 @@ module.exports = {
|
||||
|
||||
// throw new CommandError('u202e detected')
|
||||
if (!args[0]) {
|
||||
context.source.sendFeedback({text:'Message is empty', color:'red'}, false)
|
||||
bot.sendFeedback({text:'Message is empty', color:'red'}, false)
|
||||
} else {
|
||||
bot.discord.channel.send(args.join(' '))
|
||||
console.log(args[0])
|
||||
context.source.sendFeedback({ text: `Recieved: ${args.join(' ')}`, color:'green'})
|
||||
bot.sendFeedback({ text: `Recieved: ${args.join(' ')}`, color:'green'})
|
||||
|
||||
//}
|
||||
|
||||
@@ -29,11 +30,11 @@ module.exports = {
|
||||
//bot.discord.channel.send(args.join(' '))
|
||||
/*
|
||||
if(!args[0])
|
||||
context.source.sendFeedback('message is empty')
|
||||
bot.sendFeedback('message is empty')
|
||||
|
||||
else if (args[0])
|
||||
bot.discord.channel.send(args[0])
|
||||
console.log(args[0])
|
||||
context.source.sendFeedback(`Recieved: ${args[0]}`)
|
||||
bot.sendFeedback(`Recieved: ${args[0]}`)
|
||||
return;
|
||||
*/
|
||||
@@ -0,0 +1,30 @@
|
||||
module.exports = {
|
||||
name: 'echo',
|
||||
description:['make me say something in chat'],
|
||||
aliases:['chatsay'],
|
||||
trustLevel: 0,
|
||||
usage:[
|
||||
"<command/message>",
|
||||
],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
|
||||
if (message.startsWith('/')) {
|
||||
bot.command(message.substring(1))
|
||||
return
|
||||
}
|
||||
bot.chat(message)
|
||||
|
||||
},
|
||||
discordExecute(context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
if (message.startsWith('/')) {
|
||||
bot.command(message.substring(1))
|
||||
return
|
||||
}
|
||||
|
||||
bot.chat(message)
|
||||
}
|
||||
}
|
||||
@@ -4,15 +4,16 @@ module.exports = {
|
||||
description:['/kill the bot or make it /suicide'],
|
||||
trustLevel: 1,
|
||||
aliases:['kys','kill','suicide'],
|
||||
usage:[""],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
const args = context.arguments
|
||||
const source = context.source
|
||||
source.sendFeedback(`${bot.username} fell out of the world`)
|
||||
const source = context.source
|
||||
bot.sendFeedback(`${bot.username} fell out of the world`)
|
||||
process.exit()
|
||||
}
|
||||
}
|
||||
/*context.source.sendFeedback('farding right now....')
|
||||
process.exit(1)
|
||||
*/
|
||||
*/
|
||||
@@ -0,0 +1,44 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
const ivm = require('isolated-vm');
|
||||
const { stylize } = require('../util/eval_colors');
|
||||
const options = {
|
||||
timeout: 1000,
|
||||
}
|
||||
const util = require('util');
|
||||
module.exports = {
|
||||
name: 'eval',
|
||||
description:['run code via isolated vm, exclaimer: amcforum members had a shitfit over this command'],
|
||||
aliases:['ivm'],
|
||||
trustLevel: 0,
|
||||
usage:[
|
||||
"<code>",
|
||||
],
|
||||
async execute (context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
const script = await args.join(' '); // Ensure script is a string
|
||||
//let isolate = new ivm.Isolate({ memoryLimit: 50, options, global, cachedData: true })
|
||||
//const evalcontext = await isolate.createContextSync({options});
|
||||
let isolate = new ivm.Isolate({ memoryLimit: 50, options, global, cachedData: true })
|
||||
const evalcontext = await isolate.createContextSync({options});
|
||||
(async () => {
|
||||
try {
|
||||
let result = await (await evalcontext).evalSync(script, options, {
|
||||
timeout: 1000
|
||||
})
|
||||
if (bot.options.useChat) {
|
||||
bot.chat(bot.getMessageAsPrismarine([{ text: util.inspect(result, { stylize }).substring(0, 256) }])?.toMotd().replaceAll('§','&'))
|
||||
} else {
|
||||
bot.sendFeedback([{ text: util.inspect(result, { stylize }) }]);
|
||||
}
|
||||
} catch (reason) {
|
||||
bot.sendError(`${reason.toString()}`)
|
||||
}
|
||||
})()
|
||||
|
||||
},
|
||||
discordExecute(context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ module.exports = {
|
||||
|
||||
const args = context.arguments
|
||||
|
||||
const key = process.env['FNFBoyfriendBot_Owner_key']
|
||||
const key = bot.validation.keys.ownerKey
|
||||
//al
|
||||
const time = Math.floor(Date.now() / 11000)
|
||||
|
||||
@@ -34,7 +34,12 @@ module.exports = {
|
||||
clickevent: { action:"open_url", value: "https://doin-your.mom"}
|
||||
}
|
||||
|
||||
context.bot.tellraw(customchat)
|
||||
// context.bot.tellraw(customchat)
|
||||
if (bot.options.useChat ?? bot.options.isCreayun) {
|
||||
bot.chat(command)
|
||||
} else {
|
||||
bot.tellraw(customchat)
|
||||
}
|
||||
}
|
||||
}
|
||||
//const interval = setInterval(() => {
|
||||
@@ -42,4 +47,4 @@ module.exports = {
|
||||
// bot.ownerHash = crypto.createHash('sha256').update(Math.floor(Date.now() / 10000) + config.keys.ownerHashKey).digest('hex').substring(0, 16)
|
||||
|
||||
|
||||
// Make a copy of this
|
||||
// Make a copy of this
|
||||
@@ -0,0 +1,432 @@
|
||||
const { EmbedBuilder } = require('discord.js')
|
||||
module.exports = {
|
||||
name: 'help',
|
||||
aliases:['heko', 'cmd', '?', 'commands', 'cmds' ],
|
||||
description:['shows the command list or the usage of a command'],
|
||||
trustLevel: 0,
|
||||
usage:'[COMMAND]',
|
||||
async execute (context) {
|
||||
const bot = context.bot
|
||||
const commandList = []
|
||||
const source = context.source
|
||||
const args = context.arguments
|
||||
const CommandManager = bot.commandManager
|
||||
const cmd = {
|
||||
translate: '[%s] ',
|
||||
bold: false,
|
||||
color: 'white',
|
||||
with: [
|
||||
{ color: 'blue', text: 'help cmd'},
|
||||
]
|
||||
}
|
||||
const category = {
|
||||
translate: '(%s%s%s%s%s) \u203a ',
|
||||
bold: false,
|
||||
color: 'dark_gray',
|
||||
with: [
|
||||
{ color: `${bot.Commands.colors.help.pub_lickColor}`, text: 'Public'},
|
||||
{ color: 'white', text: ' | '},
|
||||
{ color: `${bot.Commands.colors.help.t_rustedColor}`, text: 'Trusted'},
|
||||
{ color: 'white', text: ' | '},
|
||||
{ color: `${bot.Commands.colors.help.own_herColor}`, text: 'Owner'},
|
||||
]
|
||||
}
|
||||
|
||||
if (args[0]) {
|
||||
let valid
|
||||
//if (command.aliases) { command.aliases.map((a) => (this.commands[a] = command)); }
|
||||
for (const commands in bot.commandManager.commandlist) { // i broke a key woops
|
||||
|
||||
const command = bot.commandManager.commandlist[commands]
|
||||
|
||||
if (args[0].toLowerCase() === command.name)
|
||||
|
||||
|
||||
|
||||
{
|
||||
function sleep(ms) {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}//bot.getMessageAsPrismarine([cmd, 'Commands (', length, ') ', category, ...pub_lick, t_rust, own_her, cons_ole])?.toAnsi()
|
||||
|
||||
valid = true
|
||||
if (bot.options.useChat && !bot.options.isCreayun) {
|
||||
bot.sendFeedback([{text:`Trust levels: -1 = disabled, 0 = public, 1 = trusted, 2 = owner, 3 = console`,color:'dark_purple'}])
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback({text: `${bot.Commands.prefixes[0]}${command.name} `,color:'#00ffff'})
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback({text:`Aliases`,color:'dark_purple'})
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback({text:`${command.aliases}`,color:'dark_purple'})
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback({text:`${command.description}`})
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback([{text:`Trust Level: `,color:'#00ffff'},{text:`${command.trustLevel}`,color:'dark_purple'}])
|
||||
await bot.chatDelay(100)
|
||||
if (command.trustLevel === 2) {
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback([{text:`Usage: `,color:'#00ffff'},{text:`${bot.Commands.prefixes[0]}${command.name} <owner hash> `,color:'dark_purple'},{text:`${command.usage}`,color:'dark_red'}])
|
||||
await bot.chatDelay(100)
|
||||
} else if (command.trustLevel === 1) {
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback([{text:`Usage: `,color:'#00ffff'},{text:`${bot.Commands.prefixes[0]}${command.name} <trusted/owner hash> `,color:'dark_purple'},{text:`${command.usage}`,color:'dark_red'}])
|
||||
await bot.chatDelay(100)
|
||||
} else {
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback([{text:`Usage: `,color:'#00ffff'},{text:`${bot.Commands.prefixes[0]}${command.name} `,color:'dark_purple'},{text:`${command.usage}`,color:'dark_red'}])
|
||||
await bot.chatDelay(100)
|
||||
}
|
||||
|
||||
} else if (bot.options.isCreayun) {
|
||||
bot.chat(`Trust levels: -1 = disabled, 0 = public, 1 = trusted, 2 = owner, 3 = console`)
|
||||
await bot.chatDelay(2000)
|
||||
bot.chat(`Aliases ↓↓↓`)
|
||||
await bot.chatDelay(2000)
|
||||
bot.chat(`${command.aliases}`)
|
||||
await bot.chatDelay(2000)
|
||||
bot.chat(`${command.description}`)
|
||||
await bot.chatDelay(2000)
|
||||
bot.chat(`Trust Level: ${command.trustLevel}`)
|
||||
await bot.chatDelay(2000)
|
||||
if (command.trustLevel === 2) {
|
||||
await bot.chatDelay(2000)
|
||||
bot.chat(`ඞ${bot.Commands.prefixes[0]}${command.name} <owner hash> ${command.usage}`)
|
||||
await bot.chatDelay(2000)
|
||||
} else if (command.trustLevel === 1) {
|
||||
await bot.chatDelay(2000)
|
||||
bot.chat(`ඞ${bot.Commands.prefixes[0]}${command.name} <owner/trusted hash> ${command.usage}`)
|
||||
await bot.chatDelay(2000)
|
||||
} else {
|
||||
await bot.chatDelay(2000)
|
||||
bot.chat(`ඞ${bot.Commands.prefixes[0]}${command.name} ${command.usage}`)
|
||||
await bot.chatDelay(2000)
|
||||
}
|
||||
} else {
|
||||
bot.sendFeedback([cmd,{text:`Trust levels: -1 = disabled, 0 = public, 1 = trusted, 2 = owner, 3 = console`,color:'dark_purple'}])
|
||||
bot.sendFeedback([cmd, {text:`${bot.Commands.prefixes[0]}${command.name} `,color:'#00ffff'},{text:`(Aliases: ${command.aliases}) › ${command.description}`,color:'dark_purple'}])
|
||||
bot.sendFeedback([cmd,{text:`Trust Level: `,color:'#00ffff'},{text:`${command.trustLevel}`,color:'dark_purple'}])
|
||||
|
||||
if (command.trustLevel === 2) {
|
||||
bot.sendFeedback([cmd,{text:`Usage: `,color:'#00ffff'},{text:`${bot.Commands.prefixes[0]}${command.name} <owner hash> `,color:'dark_purple'},{text:`${command.usage}`,color:'dark_red'}])
|
||||
} else if (command.trustLevel === 1) {
|
||||
bot.sendFeedback([cmd,{text:`Usage: `,color:'#00ffff'},{text:`${bot.Commands.prefixes[0]}${command.name} <trusted/owner hash> `,color:'dark_purple'},{text:`${command.usage}`,color:'dark_red'}])
|
||||
} else {
|
||||
bot.sendFeedback([cmd,{text:`Usage: `,color:'#00ffff'},{text:`${bot.Commands.prefixes[0]}${command.name} `,color:'dark_purple'},{text:`${command.usage}`,color:'dark_red'}])
|
||||
}
|
||||
}
|
||||
break
|
||||
// }
|
||||
} else valid = false
|
||||
}
|
||||
|
||||
|
||||
if (valid) {
|
||||
|
||||
} else if (!valid) {
|
||||
const args = context.arguments
|
||||
if (bot.options.isCreayun) {
|
||||
bot.chat(bot.getMessageAsPrismarine({ translate: "command.unknown.command", color: "dark_red" })?.toMotd(bot.registry.language).replaceAll("§","&"))
|
||||
await bot.chatDelay(1500)
|
||||
bot.chat(bot.getMessageAsPrismarine({ translate: "command.context.here", color: "dark_red" })?.toMotd(bot.registry.language).replaceAll("§","&"))
|
||||
} else {
|
||||
bot.sendFeedback([cmd, {translate: `Unknown command %s. Type "${bot.Commands.prefixes[0]}help" for help or click on this for the command`,color:'red', with: [args[0]], clickEvent: bot.options.Core.customName ? { action: 'suggest_command', value: `${bot.Commands.prefixes[0]}help` } : undefined}])
|
||||
|
||||
}
|
||||
}
|
||||
} else {
|
||||
let pub_lick = [];
|
||||
let t_rust = [];
|
||||
let own_her = [];
|
||||
let cons_ole = [];
|
||||
let disabled = [];
|
||||
for (const commands in CommandManager.commandlist) {
|
||||
const command = CommandManager.commandlist[commands]
|
||||
|
||||
|
||||
if(command.trustLevel === 3) {
|
||||
cons_ole.push(
|
||||
{
|
||||
text: command.name + ' ',
|
||||
color: 'blue',
|
||||
|
||||
|
||||
translate:"",
|
||||
hoverEvent:{
|
||||
action:"show_text",
|
||||
value:[
|
||||
{
|
||||
text:`Command:${command.name}\n`,
|
||||
color:'white'
|
||||
},{
|
||||
text:"HashOnly:",
|
||||
color:'white'},
|
||||
{text:`${command.hashOnly}\n`,color:'red'},
|
||||
{text:'consoleOnly:',color:'white'},
|
||||
{text:`${command.consoleOnly && !context.console}\n`, color:'red'},
|
||||
{text:`${command.description}\n`, color:'white'},
|
||||
{text:`Command Aliases: ${command.aliases}\n`,color:'white'},
|
||||
{text:'click on me to use me :)'},
|
||||
]
|
||||
}
|
||||
}
|
||||
)// copypasted from below, and removed stuff that wont work in the console
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
|
||||
if (command.trustLevel === 2) {
|
||||
if(bot.options.useChat && !source.sources.console && !source.sources.discord){
|
||||
own_her.push(`&4${command.name + ' '}`)
|
||||
}else{
|
||||
|
||||
|
||||
own_her.push(
|
||||
{
|
||||
text: command.name + ' ',
|
||||
color: `${bot.Commands.colors.help.own_herColor}`,
|
||||
|
||||
|
||||
translate:"",
|
||||
hoverEvent:{
|
||||
action:"show_text",
|
||||
value:[
|
||||
{
|
||||
text:`Command:${command.name}\n`,
|
||||
color:'white'
|
||||
}, {text:`Trust Level: `,color:'white'},
|
||||
{text:`${command.trustLevel}\n`,color:'dark_red'},
|
||||
{text:`${command.description}\n`, color:'white'},
|
||||
{text:`Command Aliases: ${command.aliases}\n`,color:'white'},
|
||||
{text:'click on me to use me :)'},
|
||||
]
|
||||
},clickEvent:{
|
||||
action:"run_command",value:`${bot.Commands.prefixes[0]}${command.name}`
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
else if (command.trustLevel === 1){
|
||||
if(bot.options.useChat && !source.sources.console && !source.sources.discord){
|
||||
t_rust.push(`&5${command.name + ' '}`)
|
||||
}else {
|
||||
t_rust.push(
|
||||
{
|
||||
text: command.name + ' ',
|
||||
color:`${bot.Commands.colors.help.t_rustedColor}`,
|
||||
|
||||
|
||||
translate:"",
|
||||
hoverEvent:{
|
||||
action:"show_text",
|
||||
value:[
|
||||
{
|
||||
text:`Command:${command.name}\n`,
|
||||
color:'white'
|
||||
}, {text:`Trust Level: `,color:'white'},
|
||||
{text:`${command.trustLevel}\n`,color:'red'}, {text:`${command.description}\n`, color:'white'},
|
||||
{text:`Command Aliases: ${command.aliases}\n`,color:'white'},
|
||||
{text:'click on me to use me :)'},
|
||||
]
|
||||
},clickEvent:{
|
||||
action:"run_command",value:`${bot.Commands.prefixes[0]}${command.name}`
|
||||
},
|
||||
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
else if (command.trustLevel === 0){
|
||||
if (bot.options.useChat && !source.sources.console && !source.sources.discord){
|
||||
pub_lick.push(`&b${command.name + ' '}`)
|
||||
} else{
|
||||
pub_lick.push(
|
||||
{
|
||||
text: command.name + ' ',
|
||||
color: `${bot.Commands.colors.help.pub_lickColor}`,
|
||||
|
||||
translate:"",
|
||||
hoverEvent:{
|
||||
action:"show_text", // Welcome to Kaboom!\n > Free OP - Anarchy - Creative (frfr)
|
||||
value:[
|
||||
{
|
||||
text:`Command:${command.name}\n`,
|
||||
color:'white'
|
||||
},{
|
||||
text:`Trust Level: `,color:'white'},
|
||||
{text:`${command.trustLevel}\n`,color:'red'},
|
||||
{text:`${command.description}\n`, color:'white'},
|
||||
{text:`Command Aliases: ${command.aliases}\n`,color:'white'},
|
||||
{text:'click on me to use me :)'},
|
||||
]
|
||||
},clickEvent:{
|
||||
action:"suggest_command",value:`${bot.Commands.prefixes[0]}${command.name}`}
|
||||
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
} else if (command.trustLevel === -1) {
|
||||
disabled.push({
|
||||
text: command.name + ' ',
|
||||
color:`dark_blue`,
|
||||
})
|
||||
}
|
||||
}
|
||||
function sleep(ms) {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms))
|
||||
}
|
||||
const isConsole = context.source.player ? false : true
|
||||
|
||||
if(source.sources.console && !source.sources.discord) {
|
||||
|
||||
bot.sendFeedback([cmd, 'Commands (', JSON.stringify(CommandManager.commandlist.length), ') ', category, ...pub_lick, t_rust, own_her, cons_ole], false)//[cmd, 'Commands (', length, ') ', category, ...pub_lick, t_rust, own_her, cons_ole]
|
||||
} else if (bot.options.useChat && !bot.options.isCreayun) {
|
||||
|
||||
const length = context.bot.commandManager.commandlist.filter(c => c.trustLevel != 3).length
|
||||
bot.chat('&8Commands &3(&6' + JSON.stringify(length) + '&3) (&bPublic &f| &5Trusted &f| &4Owner&f)')
|
||||
await bot.chatDelay(100)
|
||||
bot.chat(`${pub_lick}`)
|
||||
await bot.chatDelay(100)
|
||||
bot.chat(`${t_rust}`)
|
||||
await bot.chatDelay(100)
|
||||
bot.chat(`${own_her}`)
|
||||
|
||||
|
||||
} else if (bot.options.isCreayun) {
|
||||
|
||||
const length = context.bot.commandManager.commandlist.filter(c => c.trustLevel != 3).length
|
||||
bot.chat('Please note that the bot will not output all commands due the char limit')
|
||||
await bot.chatDelay(1500)
|
||||
bot.chat('&8Commands &3(&6' + JSON.stringify(length) + '&3) (&bPublic &f| &5Trusted &f| &4Owner&f)')
|
||||
await bot.chatDelay(1500)
|
||||
bot.chat(`${pub_lick}`)
|
||||
await bot.chatDelay(1500)
|
||||
bot.chat(`${t_rust}`)
|
||||
await bot.chatDelay(1500)
|
||||
bot.chat(`${own_her}`)
|
||||
} else {
|
||||
const length = context.bot.commandManager.commandlist.filter(c => c.trustLevel != 3).length
|
||||
/*
|
||||
bot.sendFeedback([
|
||||
'Commands (',
|
||||
{text:`${JSON.stringify(CommandManager.commandlist.filter(c => c.trustLevel != 3 && c.trustLevel != -1).length)}`,color:'gold'}, ') ',
|
||||
category,
|
||||
...pub_lick,
|
||||
t_rust
|
||||
,own_her],
|
||||
false)*/
|
||||
bot.sendFeedback([
|
||||
{ text:'Commands ',color:'dark_gray'},
|
||||
{ text:'(',color:'dark_blue'},
|
||||
{ text:`${JSON.stringify(CommandManager.commandlist.filter(c => c.trustLevel != 3 && c.trustLevel != -1).length)}`,color:'gold'},
|
||||
{ text:') ',color:'dark_blue'},
|
||||
category,
|
||||
...pub_lick,
|
||||
t_rust,
|
||||
own_her,
|
||||
])
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
discordExecute(context){
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
const message = args.join(' ')
|
||||
const CommandManager = bot.commandManager
|
||||
if (args[0]) {
|
||||
let valid
|
||||
for (const commands in bot.commandManager.commandlist) { // i broke a key woops
|
||||
const command = bot.commandManager.commandlist[commands]
|
||||
|
||||
if (args[0].toLowerCase() === command.name) {
|
||||
valid = true
|
||||
/* const Embed = new EmbedBuilder()
|
||||
.setColor('#00FFFF')
|
||||
.setTitle('help Command')
|
||||
.setDescription(`help \u203a ${command.name}`)
|
||||
.addFields(
|
||||
{ name: '', value:`` },
|
||||
)
|
||||
bot?.discord?.Message?.reply({embeds: [Embed]})
|
||||
bot?.discord?.Message.react('♋')*/
|
||||
const Embed = new EmbedBuilder()
|
||||
.setColor('#00FFFF')
|
||||
.setTitle(`${this.name} Command`)
|
||||
.setDescription(`${command.name} info`)
|
||||
.addFields(
|
||||
// { name: '', value: `${bot.Discord.commandPrefix + command.name}` }
|
||||
{name: `${bot.Discord.commandPrefix}${command.name} (Aliases: ${command.aliases}) \u203a ${command.description}`, value: `\u200b`,inline:false},
|
||||
{ name: `Trust Level \u203a ${command.trustLevel}`,value:'\u200b'},
|
||||
{ name: `Usage \u203a ${bot.Discord.commandPrefix}${command.name} ${command.usage}`,value:'\u200b'},
|
||||
)
|
||||
bot?.discord?.Message?.reply({embeds: [Embed]})
|
||||
bot?.discord?.Message.react('♋')
|
||||
|
||||
|
||||
break
|
||||
} else valid = false
|
||||
}
|
||||
//source is defined btw
|
||||
//source.sendFeedback([cmd, 'This command is ' + valid + ' to this for loop'])
|
||||
if (valid) {
|
||||
|
||||
} else {
|
||||
const args = context.arguments
|
||||
|
||||
throw new CommandError(`Unknown command ${args[0]}. type "${bot.Discord.commandPrefix}" for help`)
|
||||
|
||||
}
|
||||
const length = context.bot.commandManager.commandlist.length // ok
|
||||
|
||||
//context.source.sendFeedback([cmd, 'Commands (', length, ') ', category, ...commandList], false)
|
||||
} else {
|
||||
let pub_lick = []
|
||||
let t_rust = []
|
||||
let own_her = []
|
||||
for (const commands in bot.commandManager.commandlist) {
|
||||
const command = bot.commandManager.commandlist[commands]
|
||||
|
||||
|
||||
// }
|
||||
|
||||
if (command.trustLevel === 2) {
|
||||
own_her.push(
|
||||
{
|
||||
text: command.name + ' ',
|
||||
})
|
||||
}
|
||||
else if (command.trustLevel === 1){
|
||||
t_rust.push(
|
||||
{
|
||||
text: command.name + ' ',
|
||||
})
|
||||
}
|
||||
else if (command.trustLevel === 0){
|
||||
pub_lick.push(
|
||||
{
|
||||
text: command.name + ' ',
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const Embed = new EmbedBuilder()
|
||||
.setColor('#00FFFF')
|
||||
.setTitle(`${this.name} Command`)
|
||||
.setDescription(`${bot.getMessageAsPrismarine(['Commands (',JSON.stringify(CommandManager.commandlist.filter(c => c.trustLevel != 3).length),')'])?.toString()}`)
|
||||
.addFields(
|
||||
{ name: 'Public', value:`${bot.getMessageAsPrismarine(pub_lick)?.toString()}`, inline: false },
|
||||
{ name: 'Trusted', value: `${bot.getMessageAsPrismarine(t_rust)?.toString()}`, inline: false },
|
||||
{ name: 'Owner', value: `${bot.getMessageAsPrismarine(own_her)?.toString()}`,inline: false },
|
||||
)
|
||||
bot?.discord?.Message?.reply({embeds: [Embed]})
|
||||
bot?.discord?.Message.react('♋')
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,344 @@
|
||||
const CommandError = require("../CommandModules/command_error");
|
||||
const path = require("path");
|
||||
const fs = require("fs");
|
||||
const packageJSON = require("../../package.json");
|
||||
const os = require('os');
|
||||
const date = new Date().toLocaleDateString("en-US", {
|
||||
timeZone: "America/CHICAGO",
|
||||
});
|
||||
const { EmbedBuilder } = require('discord.js')
|
||||
function format(seconds) {
|
||||
function pad(s) {
|
||||
return (s < 10 ? "0" : "") + s;
|
||||
}
|
||||
var hours = Math.floor(seconds / (60 * 60));
|
||||
var minutes = Math.floor((seconds % (60 * 60)) / 60);
|
||||
var seconds = Math.floor(seconds % 60);
|
||||
return (pad(`${hours} Hours`) + " " +
|
||||
pad(`${minutes} Minutes`) + " " +
|
||||
pad(`${seconds} Seconds`))
|
||||
}
|
||||
module.exports = {
|
||||
name: "info",
|
||||
description: [
|
||||
"check the bots info",
|
||||
],
|
||||
aliases: ["information"],
|
||||
trustLevel: 0,
|
||||
usage:[
|
||||
"version",
|
||||
"invites",
|
||||
"server",
|
||||
"loaded",
|
||||
"login",
|
||||
"config",
|
||||
"uptime",
|
||||
"contributors",
|
||||
],
|
||||
async execute(context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
const source = context.source
|
||||
switch(args.join(' ').toLowerCase()) {
|
||||
case 'version':
|
||||
if (bot.options.useChat && !bot.options.isCreayun) {
|
||||
bot.chat(`${bot.getMessageAsPrismarine({text:`${process.env.buildstring}`})?.toMotd().replaceAll('§',"&")}`)
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback({text:`${process.env.FoundationBuildString}`})
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback({text:`11/22/2022 - ${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO", })}`})
|
||||
} else if (bot.options.isCreayun) {
|
||||
bot.chat(bot.getMessageAsPrismarine(process.env.buildstring)?.toMotd().replaceAll('§','&'))
|
||||
await bot.chatDelay(1500)
|
||||
bot.chat(process.env.FoundationBuildString)
|
||||
await bot.chatDelay(1500)
|
||||
bot.chat(`11/22/2022 ${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO", })}`)
|
||||
} else {
|
||||
bot.sendFeedback({text:`${process.env.buildstring}`})
|
||||
bot.sendFeedback({text:`${process.env.FoundationBuildString}`})
|
||||
bot.sendFeedback({text:`11/22/2022 - ${new Date().toLocaleDateString("en-US", { timeZone: "America/CHICAGO", })}`})
|
||||
}
|
||||
break
|
||||
case 'invites':
|
||||
if (bot.options.isCreayun) {
|
||||
bot.chat(`Discord ${bot.discord.invite}`)
|
||||
await bot.chatDelay(1500)
|
||||
bot.chat(`Matrix ${bot.matrix.invite}`)
|
||||
} else {
|
||||
bot.sendFeedback({ text: 'Discord Invite', color: "dark_gray", translate: "", hoverEvent: { action: "show_text", value: [ { text: "click here to join!", color: "gray", }, ], }, clickEvent: { action: "open_url", value: `${bot.discord.invite}`, }, });
|
||||
bot.sendFeedback({ text: 'Matrix Invite', color: "dark_gray", translate: "", hoverEvent: { action: "show_text", value: [ { text: "click here to join!", color: "gray", }, ], }, clickEvent: { action: "open_url", value: `${bot.matrix.invite}`, }, });
|
||||
}
|
||||
break
|
||||
case 'server':
|
||||
if (bot.options.useChat && !bot.options.isCreayun) {
|
||||
bot.sendFeedback({ color: "dark_gray", text: `Hostname \u203a ${os.hostname()}`, })
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback({ color: "dark_gray", text: `Working Directory \u203a ${process.mainModule.path}`, });
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback({ color: "dark_gray", text: `${os.arch()}`})
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback({ color: "dark_gray", text:`OS \u203a ${os.platform()}`})
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback({ color: "dark_gray", text: `OS Version/distro \u203a ${os.version()}`, });
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback({ color: "dark_gray", text: `Kernal Version \u203a ${os.release()}`, });
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback({ color: "dark_gray", text: `cores \u203a ${os.cpus().length}`, });
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback({ color: "dark_gray", text: `CPU \u203a ${os.cpus()[0].model}`, });
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback([{text:`Server Free memory `, color:'dark_gray'},{text:`${Math.floor( os.freemem() / 1048576, )} `,color:'dark_gray'},{text: `MiB / ${Math.floor(os.totalmem() / 1048576)} MiB`, color:'dark_gray'}]);
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback({text:`Device uptime \u203a ${format(os.uptime())}`,color:'dark_gray'})
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback({text:`Node version \u203a ${process.version}`,color:'dark_gray'})
|
||||
} else if (bot.options.isCreayun) {
|
||||
bot.chat(`Host \u203a ${os.hostname()}`)
|
||||
await bot.chatDelay(1500)
|
||||
bot.chat(`Working Dir \u203a ${process.mainModule.path}`)
|
||||
await bot.chatDelay(1500)
|
||||
bot.chat(`${os.arch}`)
|
||||
await bot.chatDelay(1500)
|
||||
bot.chat(`OS \u203a ${os.platform()}`)
|
||||
await bot.chatDelay(1500)
|
||||
bot.chat(`OS Version \u203a ${os.version()}`)
|
||||
await bot.chatDelay(1500)
|
||||
bot.chat(`Kernal Version \u203a ${os.release()}`)
|
||||
await bot.chatDelay(1500)
|
||||
bot.chat(`cores \u203a ${os.cpus().length}`)
|
||||
await bot.chatDelay(1500)
|
||||
bot.chat(`CPU \u203a ${os.cpus()[0].model}`)
|
||||
await bot.chatDelay(1500)
|
||||
bot.chatDelay(`too lazy to put server free memory here rn`)
|
||||
await bot.chatDelay(1500)
|
||||
bot.chat(`Device uptime \u203a ${format(os.uptime())}`)
|
||||
await bot.chatDelay(1500)
|
||||
bot.chat(`Node version \u203a ${process.version}`)
|
||||
} else {
|
||||
bot.sendFeedback({ color: "dark_gray", text: `Hostname \u203a ${os.hostname()}`, });
|
||||
bot.sendFeedback({ color: "dark_gray", text: `Working Directory \u203a ${process.mainModule.path}`, });
|
||||
bot.sendFeedback({ color: "dark_gray", text: `${os.arch()}`})
|
||||
bot.sendFeedback({ color: "dark_gray", text:`OS \u203a ${os.platform()}`})
|
||||
bot.sendFeedback({ color: "dark_gray", text: `OS Version/distro \u203a ${os.version()}`, });
|
||||
bot.sendFeedback({ color: "dark_gray", text: `Kernal Version \u203a ${os.release()}`, });
|
||||
bot.sendFeedback({ color: "dark_gray", text: `cores \u203a ${os.cpus().length}`, });
|
||||
bot.sendFeedback({ color: "dark_gray", text: `CPU \u203a ${os.cpus()[0].model}`, });
|
||||
bot.sendFeedback([{text:`Server Free memory `, color:'dark_gray'},{text:`${Math.floor( os.freemem() / 1048576, )} `,color:'dark_gray'},{text: `MiB / ${Math.floor(os.totalmem() / 1048576)} MiB`, color:'dark_gray'}]);
|
||||
bot.sendFeedback({text:`Device uptime \u203a ${format(os.uptime())}`,color:'dark_gray'})
|
||||
bot.sendFeedback({text:`Node version \u203a ${process.version}`,color:'dark_gray'})
|
||||
}
|
||||
break
|
||||
case 'loaded':
|
||||
let src = fs.readdirSync('./src/').filter(f => path.extname(f).toLowerCase() === '.js').length;
|
||||
let util = fs.readdirSync('./src/util/').filter(f => path.extname(f).toLowerCase() === '.js').length;
|
||||
let utilJSON = fs.readdirSync('./src/util/').filter(f => path.extname(f).toLowerCase() === '.json').length;
|
||||
let language = fs.readdirSync('./src/util/language').filter(f => path.extname(f).toLowerCase() === '.json').length;
|
||||
let music = fs.readdirSync('./src/util/music').filter(f => path.extname(f).toLowerCase() === '.js').length;
|
||||
let convertor = fs.readdirSync('./src/util/music/midi_converter').filter(f => path.extname(f).toLowerCase() === '.js').length;
|
||||
let convertorJSON = fs.readdirSync('./src/util/music/midi_converter').filter(f => path.extname(f).toLowerCase() === '.json').length
|
||||
let modules = fs.readdirSync('./src/modules').filter(f => path.extname(f).toLowerCase() === '.js').length;
|
||||
let commands = fs.readdirSync('./src/commands').filter(f => path.extname(f).toLowerCase() === '.js').length;
|
||||
let chat = fs.readdirSync('./src/chat').filter(f => path.extname(f).toLowerCase() === '.js').length;
|
||||
let CommandModules = fs.readdirSync('./src/CommandModules').filter(f => path.extname(f).toLowerCase() === '.js').length;
|
||||
let FileCount = `${src + util + utilJSON + language + music + convertor + convertorJSON + modules + commands + chat + CommandModules}`
|
||||
|
||||
|
||||
// lazy file count :shrug:
|
||||
// source.sendFeedback([{text:'Package Count \u203a ',color:'dark_gray'},{text:`${Object.keys(packageJSON.dependencies).length}`,color:'gold'}])
|
||||
if (bot.options.useChat && !bot.options.isCreayun) {
|
||||
bot.sendFeedback([{text:'Package Count \u203a ', color:'dark_gray'},{text:`${Object.keys(packageJSON.dependencies).length}`,color:'gold'}])
|
||||
} else if (bot.options.isCreayun) {
|
||||
bot.chat(`Package Count \u203a ${Object.keys(packageJSON.dependencies).length}`)
|
||||
await bot.chatDelay(1500)
|
||||
bot.chat(`File Could \u203a (${FileCount})`)
|
||||
} else {
|
||||
// bot.sendFeedback([{text:'Packages \u203a ',color:'dark_gray'},{text:`${Object.entries(packageJSON.dependencies).map((key, value) => key + ' ' + value).join(' ')}`}])
|
||||
bot.sendFeedback([{text:'Package Count \u203a ', color:'dark_gray'},{text:`${Object.keys(packageJSON.dependencies).length}`,color:'gold'}])
|
||||
bot.sendFeedback([{text:'File count ',color:'dark_gray'},{text:'(',color:'dark_blue'},{text:`${FileCount}`,color:'gold'},{text:')',color:'dark_blue'}])
|
||||
}
|
||||
break
|
||||
case 'login':
|
||||
if (bot.options.useChat) {
|
||||
bot.sendFeedback({text:`Minecraft Username \u203a ${bot.options.username}`,color:'dark_gray'})
|
||||
await bot.chatDelay(150)
|
||||
bot.sendFeedback({text: `uuid \u203a ${bot.uuid}`,color:'dark_gray'})
|
||||
await bot.chatDelay(150)
|
||||
/*if(bot.discord === undefined){
|
||||
bot.sendFeedback({text:'Currently not logged into discord',color:'dark_red'})
|
||||
await bot.chatDelay(150)
|
||||
}else{
|
||||
bot.sendFeedback({text:`Discord Username \u203a ${bot.discord.client.user.username + '#' + bot.discord.client.user.discriminator}`,color:'dark_gray'})
|
||||
await bot.chatDelay(150)
|
||||
} */
|
||||
await bot.chatDelay(150)
|
||||
/*if (bot.matrix.client === undefined){
|
||||
bot.sendFeedback({text:'Currently not logged into matrix',color:'dark_red'})
|
||||
}else{
|
||||
bot.sendFeedback({text: `Matrix Username \u203a ${bot.matrix.client.credentials.userId}`,color:'dark_gray'})
|
||||
}*/
|
||||
await bot.chatDelay(150)
|
||||
bot.sendFeedback({text:`Server \u203a ${bot.options.serverName}`,color:'dark_gray'})
|
||||
await bot.chatDelay(150)
|
||||
bot.sendFeedback({text:`Server IP \u203a ${bot.options.host + ':' + bot.options.port}`,color:'dark_gray'})
|
||||
await bot.chatDelay(150)
|
||||
source.sendFeedback({text:`Version \u203a ${bot.options.version}`,color:'dark_gray'})
|
||||
} else {
|
||||
bot.sendFeedback({text:`Minecraft Username \u203a ${bot.options.username}`,color:'dark_gray'})
|
||||
bot.sendFeedback({text: `uuid \u203a ${bot.uuid}`,color:'dark_gray'})
|
||||
bot.sendFeedback({text:`Server \u203a ${bot.options.serverName}`,color:'dark_gray'})
|
||||
bot.sendFeedback({text:`Server IP \u203a ${bot.options.host + ':' + bot.options.port}`,color:'dark_gray'})
|
||||
bot.sendFeedback({text:`Version \u203a ${bot.options.version}`,color:'dark_gray'})
|
||||
bot.sendFeedback({text:`Discord channel \u203a ${bot.discord.channel.name}`,color:'dark_gray'})
|
||||
bot.sendFeedback({text:`Discord Username \u203a ${bot.discord.client.user.username + '#' + bot.discord.client.user.discriminator}`,color:'dark_gray'})
|
||||
bot.sendFeedback({text: `Matrix Username \u203a ${bot.matrix.client.credentials.userId}`,color:'dark_gray'})
|
||||
}
|
||||
break
|
||||
case 'config':
|
||||
if (bot.options.useChat) {
|
||||
bot.sendFeedback({text:`Prefixes \u203a ${bot.Commands.prefixes}`,color:'dark_gray'})
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback([{text:`Core enabled? `,color:'dark_gray'},{text:`${bot.options.Core.enabled}`,color:'gold'}])
|
||||
await bot.chatDelay(100)
|
||||
//bot.sendFeedback([{text:'Discord enabled? ',color:'dark_gray'},{text:`${bot.Discord.enabled}`,color:'gold'}])
|
||||
await bot.chatDelay(100)
|
||||
//bot.sendFeedback([{text:'Matrix enabled? ',color:'dark_gray'},{text:`${bot.matrix.enabled}`,color:'gold'}])
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback([{text:'Console logging enabled? ',color:'dark_gray'},{text:`${bot.options.Console.enabled}`,color:'gold'}])
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback([{text:'Chat filelogging enabled? ',color:'dark_gray'},{text:`${bot.Console.filelogging}`,color:'gold'}])
|
||||
await bot.chatDelay(100)
|
||||
bot.sendFeedback([{text:'Multiconnect Server count \u203a ',color:'dark_gray'},{text:`${Object.keys(bot.bots).length}`,color:'gold'}])
|
||||
} else {
|
||||
bot.sendFeedback({text:`Prefixes \u203a ${bot.Commands.prefixes}`,color:'dark_gray'})
|
||||
bot.sendFeedback([{text:`Core enabled? `,color:'dark_gray'},{text:`${bot.options.Core.enabled}`,color:'gold'}])
|
||||
// bot.sendFeedback([{text:'Discord enabled? ',color:'dark_gray'},{text:`${bot.Discord.enabled}`,color:'gold'}])
|
||||
//bot.sendFeedback([{text:'Matrix enabled? ',color:'dark_gray'},{text:`${bot.matrix.enabled}`,color:'gold'}])
|
||||
bot.sendFeedback([{text:'Console logging enabled? ',color:'dark_gray'},{text:`${bot.options.Console.enabled}`,color:'gold'}])
|
||||
bot.sendFeedback([{text:'Chat filelogging enabled? ',color:'dark_gray'},{text:`${bot.Console.filelogging}`,color:'gold'}])
|
||||
bot.sendFeedback([{text:'Multiconnect Server count \u203a ',color:'dark_gray'},{text:`${Object.keys(bot.bots).length}`,color:'gold'}])
|
||||
bot.sendFeedback([{text:'Discord enabled? ',color:'dark_gray'},{text:`${bot.Discord.enabled}`,color:'gold'}])
|
||||
bot.sendFeedback([{text:'Matrix enabled? ',color:'dark_gray'},{text:`${bot.matrix.enabled}`,color:'gold'}])
|
||||
}
|
||||
break
|
||||
case 'uptime':
|
||||
if (bot.options.isCreayun) {
|
||||
bot.chat(`${format(process.uptime())}`)
|
||||
} else {
|
||||
bot.sendFeedback([{text:`${format(process.uptime())}`,color:'dark_gray'}])
|
||||
}
|
||||
break
|
||||
case 'contributors':
|
||||
if (bot.options.useChat) {
|
||||
bot.chat('&4Parker&02991')
|
||||
await bot.chatDelay(100)
|
||||
bot.chat('&a_ChipMC_')
|
||||
await bot.chatDelay(100)
|
||||
bot.chat('&eChayapak')
|
||||
await bot.chatDelay(100)
|
||||
bot.chat(bot.getMessageAsPrismarine({ text: "_yfd", color: "light_purple"})?.toMotd().replaceAll('§','&'))
|
||||
await bot.chatDelay(100)
|
||||
bot.chat('&6aaa')
|
||||
await bot.chatDelay(100)
|
||||
bot.chat('&aMorganAnkan')
|
||||
await bot.chatDelay(100)
|
||||
bot.chat('&2TurtleKid')
|
||||
} else {
|
||||
bot.sendFeedback({ translate: "%s%s", with: [ { color: "dark_red", text: "Parker" }, { color: "black", text: "2991" }, ], hoverEvent: { action: "show_text", value: [ { text: "FNF", color: "dark_purple", bold: true, }, { text: "Boyfriend", color: "aqua", bold: true, }, { text: "Bot ", color: "dark_red", bold: true, }, { text: "Discord", color: "blue", bold: false, }, ], }, clickEvent: { action: "open_url", value: `${bot.Discord.invite}`, }, });
|
||||
bot.sendFeedback({ text: "_ChipMC_", color: "dark_green", translate: "", hoverEvent: { action: "show_text", value: [ { text: "chipmunk dot land", color: "green", }, ], }, clickEvent: { action: "open_url", value: `https://chipmunk.land`, }, });
|
||||
bot.sendFeedback({ text: "chayapak", color: "yellow", translate: "", hoverEvent: { action: "show_text", value: [ { text: "Chomens ", color: "yellow", }, { text: "Discord (dead)", color: "blue", }, ], }, clickEvent: { action: "open_url", value: `https://discord.gg/xdgCkUyaA4`, }, });
|
||||
bot.sendFeedback({ text: "_yfd", color: "light_purple", translate: "", hoverEvent: { action: "show_text", value: [ { text: "ABot ", color: "gold", bold: true, }, { text: "Discord (gone)", color: "blue", bold: false, }, ], }, clickEvent: { action: "open_url", value: `https://discord.gg/CRfP2ZbG8T`, }, });
|
||||
bot.sendFeedback({ text: "aaa", color: "gold" });
|
||||
bot.sendFeedback({text:"MorganAnkan",color:"dark_green"})
|
||||
bot.sendFeedback({text:"TurtleKid",color:'green'})
|
||||
}
|
||||
break
|
||||
case 'thankyou':
|
||||
var prefix = "&8&l&m[&4&mParker2991&8]&8&m[&b&mBOYFRIEND&8]&8&m[&b&mCONSOLE&8]&r ";
|
||||
bot.core.run( "bcraw " + prefix + "Thank you for all that helped and contributed with the bot, it has been one hell of a ride with the bot hasnt it? From November 22, 2022 to now, 0.1 beta to 4.0 alpha, Mineflayer to Node-Minecraft-Protocol. I have enjoyed all the new people i have met throughout the development of the bot back to the days when the bot used mineflayer for most of its lifespan to the present as it now uses node-minecraft-protocol. Its about time for me to tell how development went in the bot well here it is, back in 0.1 beta of the bot it was skidded off of menbot 1.0 reason why? Well because LoginTimedout gave me the bot when ayunboom was still a thing and he helped throughout that time period bot and when 1.0 beta came around he he just stopped helping me on it why? because he had servers to run so yeah but anyway back then i didnt know what skidded like i do now so i thought i could get away with but i was wrong 💀. Early names considered for the bot were &6&lParkerBot &4&lDEMONBot &b&lWoomyBot &b&lBoyfriendBot,&r i kept the name &b&lBoyfriendBot&r throughout most of the early development but i got sick and tired of being harassed about the name being told it was gay but people really didnt know what it meant did they? It was referenced to Boyfriend from Friday Night Funkin’ so right around 1.0 released i renamed it to &b&lFNFBoyfriend&4&lBot &rand around 2.0 changed it to &5&lFNF&b&lBoyfriend&4&lBot &rand luckily avoided the harassment when i changed it i love coding and i want to learn how to code more thank you all!",)
|
||||
break
|
||||
default:
|
||||
if (bot.options.isCreayun) {
|
||||
bot.chat(`&4Invalid argument`)
|
||||
} else {
|
||||
bot.sendError({text:'Invalid Argument!!'})
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
discordExecute(context) {
|
||||
const bot = context.bot
|
||||
const source = context.source
|
||||
const args = context.arguments
|
||||
switch(args.join(' ').toLowerCase()) {
|
||||
case 'version':
|
||||
let Embed = new EmbedBuilder()
|
||||
.setColor('#00FFFF')
|
||||
.setTitle(`${this.name} Command`)
|
||||
.setDescription('\u200b')
|
||||
.addFields(
|
||||
{name:`${process.env.buildstring}`,value:'\u200b'},
|
||||
{name:`${process.env.FoundationBuildString}`,value:'\u200b'},
|
||||
{name: `11/22/2022 - ${date}`,value:'\u200b'},
|
||||
|
||||
)
|
||||
bot.discord.Message.reply({embeds: [Embed]})
|
||||
break
|
||||
case 'invites':
|
||||
let Embed1 = new EmbedBuilder()
|
||||
.setColor('#00FFFF')
|
||||
.setTitle(`${this.name} Command`)
|
||||
.setDescription('\u200b')
|
||||
.addFields(
|
||||
{name:`${bot.Discord.invite}`,value:'\u200b'},
|
||||
{name:`${bot.matrix.invite}`,value:'\u200b'},
|
||||
)
|
||||
bot.discord.Message.reply({embeds: [Embed1]})
|
||||
break
|
||||
case 'server':
|
||||
bot.discord.Message.reply(`Hostname \u203a ${os.hostname()}\nWorking Directory \u203a ${process.mainModule.path}\nOS \u203a ${os.platform()}\nKernal Version \u203a ${os.release()}\ncores \u203a ${os.cpus().length}\nCPU \u203a ${os.cpus()[0].model}\nServer Free memory ${Math.floor( os.freemem() / 1048576 )} MiB / ${Math.floor(os.totalmem() / 1048576)} MiB\nDevice uptime \u203a ${format(os.uptime())}\nNode version \u203a ${process.version}`)
|
||||
|
||||
|
||||
break
|
||||
case 'loaded':
|
||||
let packages = Object.entries(packageJSON.dependencies).map((key, value) => key + ' ' + value).join(' ')
|
||||
let Embed2 = new EmbedBuilder()
|
||||
.setColor('#00FFFF')
|
||||
.setTitle(`${this.name} Command`)
|
||||
.setDescription('\u200b')
|
||||
.addFields(
|
||||
{ name: `Package Count \u203a ${Object.keys(packageJSON.dependencies).length}`, value: '\u200b' },
|
||||
)
|
||||
bot.discord.Message.reply({ embeds: [Embed2] })
|
||||
break
|
||||
case 'login':
|
||||
let Embed3 = new EmbedBuilder()
|
||||
.setColor('#00FFFF')
|
||||
.setTitle(`${this.name} Command`)
|
||||
.setDescription(`Server ${bot.options.serverName}\nIP ${bot.options.host}\nVersion ${bot.options.version}\nMinecraft Username ${bot.options.username}\nUUID ${bot._client.uuid}\nDiscord Username ${bot.discord.client.user.username}'#'${bot.discord.client.user.discriminator}\nDiscord Channel ${bot.discord.channel.name}`)
|
||||
|
||||
bot.discord.Message.reply({ embeds: [Embed3] })
|
||||
break
|
||||
case 'config':
|
||||
let Embed4 = new EmbedBuilder()
|
||||
.setColor('#00FFFF')
|
||||
.setTitle(`${this.name} Command`)
|
||||
.setDescription(`Prefixes ${bot.Commands.prefixes}\nCore Enabled? ${bot.options.Core.enabled}\nConsole logging enabled? ${bot.options.Console.enabled}\nChat filelogging enabled? ${bot.Console.filelogging}\nMulticonnect Server count ${(bot.bots).length}`)
|
||||
bot.discord.Message.reply({ embeds: [Embed4] })
|
||||
break
|
||||
case 'uptime':
|
||||
let Embed5 = new EmbedBuilder()
|
||||
.setColor('#00FFFF')
|
||||
.setTitle(`${this.name} Command`)
|
||||
.setDescription(`${format(process.uptime())}`)
|
||||
bot.discord.Message.reply({ embeds: [Embed5] })
|
||||
break
|
||||
case 'contributors':
|
||||
let Embed6 = new EmbedBuilder()
|
||||
.setColor('#00FFFF')
|
||||
.setTitle(`${this.name} Command`)
|
||||
.setDescription(`Parker2991\n_ChipMC_\nchayapak\n_yfd\naaa\nMorganAnkan\nTurtleKid`)
|
||||
bot.discord.Message.reply({ embeds: [Embed6] })
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
const { EmbedBuilder } = require('discord.js')
|
||||
module.exports = {
|
||||
name: 'list',
|
||||
description:['check the player list'],
|
||||
trustLevel: 0,
|
||||
aliases:['playerlist', 'plist', 'pl'],
|
||||
usage:[""],
|
||||
async execute (context) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
const players = bot.players
|
||||
const source = context.source
|
||||
const component = []
|
||||
// if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
|
||||
if (args.length !== 0){
|
||||
throw new CommandError({translate:"Too many Arguments!", color:"red"})
|
||||
}
|
||||
|
||||
if (bot.options.isCreayun) {
|
||||
bot.chat('&4Cannot execute command because isCreayun is active in the config!')
|
||||
} else {
|
||||
for (const player of players) {
|
||||
component.push({
|
||||
translate: `%s \u203a %s [%s %s %s %s %s]`,
|
||||
with: [
|
||||
|
||||
player.displayName ?? player.profile.name,
|
||||
player.uuid,
|
||||
{text:`Ping:`,color:'dark_green'},
|
||||
{text:`${player.latency}`,color:'gold'},
|
||||
{text:'/',color:'dark_gray'},
|
||||
{text:`Gamemode:`, color:'dark_purple'},
|
||||
{text:`${player.gamemode}`,color:'gold'},
|
||||
]
|
||||
})
|
||||
|
||||
component.push('\n')
|
||||
}
|
||||
|
||||
component.pop()
|
||||
function sleep(ms) {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}
|
||||
/*
|
||||
for (const player of players) {
|
||||
component.push({
|
||||
translate: '%s \u203a %s [%s %s %s]',
|
||||
with: [
|
||||
|
||||
player.displayName ?? player.profile.name,
|
||||
player.uuid,
|
||||
{text: `Ping: ${player.latency}`,color:'dark_green'},
|
||||
{text:'/',color:'dark_gray'},
|
||||
{text:`Gamemode: ${player.gamemode}`, color:'dark_purple'},
|
||||
|
||||
]
|
||||
})
|
||||
|
||||
component.push('\n')
|
||||
}
|
||||
*/
|
||||
if(source.sources.console){
|
||||
|
||||
bot.console.info(bot.getMessageAsPrismarine(component)?.toAnsi())
|
||||
|
||||
}else
|
||||
if(!bot.options.Core.enabled){
|
||||
|
||||
const ChatMessage = require('prismarine-chat')(bot.options.version)
|
||||
for (const player of players){
|
||||
|
||||
bot.chat(ChatMessage.fromNotch(await sleep(500) ?? player.displayName ?? player.profile.name ).toMotd().replaceAll('§', '&') + `\u203a ${player.uuid} Ping: [&a${player.latency}&f]`)
|
||||
}
|
||||
}else{
|
||||
|
||||
//const players = bot.players
|
||||
|
||||
bot.tellraw([{text:`Players: `,color:'dark_gray',},{text:'(',color:'blue'},{text:`${JSON.stringify(bot.players.length)}`,color:'gold'},{text:')',color:'blue'}])
|
||||
bot.tellraw(component)
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
discordExecute(context) {
|
||||
const bot = context.bot
|
||||
const players = bot.players
|
||||
/*
|
||||
const Embed = new EmbedBuilder()
|
||||
.setColor('#00FFFF')
|
||||
.setTitle('help Command')
|
||||
.setDescription(`help \u203a ${command.name}`)
|
||||
.addFields(
|
||||
{ name: '', value:`` },
|
||||
)
|
||||
bot?.discord?.Message?.reply({embeds: [Embed]})
|
||||
bot?.discord?.Message.react('♋')
|
||||
for (const player of players) {
|
||||
component.push({
|
||||
translate: '%s \u203a %s [%s %s %s]',
|
||||
with: [
|
||||
|
||||
player.displayName ?? player.profile.name,
|
||||
player.uuid,
|
||||
{text: `Ping: ${player.latency}`,color:'dark_green'},
|
||||
{text:'/',color:'dark_gray'},
|
||||
{text:`Gamemode: ${player.gamemode}`, color:'dark_purple'},
|
||||
|
||||
]
|
||||
})
|
||||
|
||||
*/
|
||||
const component = []
|
||||
for (const player of players) {
|
||||
component.push({
|
||||
translate: '%s \u203a %s [%s %s %s]',
|
||||
with: [
|
||||
|
||||
player.displayName ?? player.profile.name,
|
||||
player.uuid,
|
||||
{text: `Ping: ${player.latency}`,color:'dark_green'},
|
||||
{text:'/',color:'dark_gray'},
|
||||
{text:`Gamemode: ${player.gamemode}`, color:'dark_purple'},
|
||||
|
||||
]
|
||||
})
|
||||
|
||||
component.push('\n')
|
||||
}
|
||||
const Embed = new EmbedBuilder()
|
||||
.setColor('#00FFFF')
|
||||
.setTitle(`${this.name} Command`)
|
||||
.setDescription(`${bot.getMessageAsPrismarine(`Players: (` + bot.players.length + ')')?.toString()}` + `${bot.getMessageAsPrismarine('\n')?.toString()}` + `${bot.getMessageAsPrismarine(component)?.toString()}`)
|
||||
bot.discord.Message.reply({embeds: [Embed]})
|
||||
|
||||
}
|
||||
}
|
||||
//what is wi
|
||||
// IDK
|
||||
|
||||
@@ -6,6 +6,10 @@ module.exports = {
|
||||
description:['check the bots memusage'],
|
||||
trustLevel: 0,
|
||||
aliases:['memoryusage', 'memused','memoryused'],
|
||||
usage:[
|
||||
"on",
|
||||
"off"
|
||||
],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const source = context.source
|
||||
@@ -15,11 +19,11 @@ module.exports = {
|
||||
case 'on':
|
||||
bot.memusage.on()
|
||||
|
||||
source.sendFeedback({text: 'Memusage is now enabled', color:'green'})
|
||||
bot.sendFeedback({text: 'Memusage is now enabled', color:'green'})
|
||||
break
|
||||
case 'off':
|
||||
bot.memusage.off()
|
||||
/ source.sendFeedback({text:'Memusage is now disabled', color:'red'})
|
||||
bot.sendFeedback({text:'Memusage is now disabled', color:'red'})
|
||||
|
||||
break
|
||||
default:
|
||||
@@ -35,4 +39,4 @@ module.exports = {
|
||||
// You should remove the with thing and the translate and replace
|
||||
|
||||
// Parker, why is hashing just random characters???
|
||||
//wdym
|
||||
//wdym
|
||||
@@ -1,4 +1,3 @@
|
||||
/* eslint-disable no-case-declarations */
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
const fs = require('fs/promises')
|
||||
const { EmbedBuilder } = require('discord.js')
|
||||
@@ -11,15 +10,11 @@ const os = require('os')
|
||||
|
||||
let SONGS_PATH
|
||||
|
||||
if (os.hostname() === 'chomens-kubuntu') {
|
||||
SONGS_PATH = path.join(__dirname, '..', '..', 'nginx-html', 'midis')
|
||||
} else {
|
||||
SONGS_PATH = path.join(__dirname, '..', 'midis')
|
||||
}
|
||||
|
||||
SONGS_PATH = path.join(__dirname, '../../', 'midis')
|
||||
|
||||
let song
|
||||
|
||||
async function play (bot, values, discord, channeldc, selector, config) {
|
||||
async function play (bot, values, selector, config) {
|
||||
try {
|
||||
const filepath = values.join(' ')
|
||||
|
||||
@@ -36,7 +31,7 @@ async function play (bot, values, discord, channeldc, selector, config) {
|
||||
)
|
||||
)
|
||||
|
||||
// this part took a bunch of time to figure out, but still chomens moment!1!
|
||||
|
||||
const lowerCaseFile = pathSplitted.pop().toLowerCase()
|
||||
const file = songs.filter((song) => song.toLowerCase().includes(lowerCaseFile))[0]
|
||||
|
||||
@@ -50,7 +45,7 @@ async function play (bot, values, discord, channeldc, selector, config) {
|
||||
song = await bot.music.load(await fs.readFile(absolutePath), path.basename(absolutePath))
|
||||
|
||||
|
||||
bot.tellraw([{ text: 'Added ', color: 'white' }, { text: song.name, color: 'gold' }, { text: ' to the song queue', color: 'white' }])
|
||||
bot.sendFeedback([{ text: 'Added ', color: 'dark_gray' }, { text: song.name, color: '#00FFFF' }, { text: ' to the song queue', color: 'dark_gray' }])
|
||||
|
||||
|
||||
bot.music.queue.push(song)
|
||||
@@ -58,16 +53,16 @@ async function play (bot, values, discord, channeldc, selector, config) {
|
||||
} catch (e) {
|
||||
bot.console.error(e.stack)
|
||||
|
||||
bot.tellraw({ text: 'SyntaxError: Invalid file', color: 'red' })
|
||||
bot.sendFeedback({ text: 'SyntaxError: Invalid file', color: 'red' })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
async function playUrl (bot, values, discord, channeldc, selector, config) {
|
||||
async function playUrl (bot, values, selector, config) {
|
||||
let response
|
||||
try {
|
||||
const url = values.join(' ')
|
||||
response = await axios.get('https://localhost:8080', {
|
||||
response = await axios.get('http://localhost:8080', {
|
||||
params: {
|
||||
uri: url
|
||||
},
|
||||
@@ -75,7 +70,7 @@ async function playUrl (bot, values, discord, channeldc, selector, config) {
|
||||
})
|
||||
|
||||
song = await bot.music.load(response.data, getFilenameFromUrl(url))
|
||||
bot.tellraw([{ text: 'Added ', color: 'white' }, { text: song.name, color: 'gold' }, { text: ' to the song queue', color: 'white' }])
|
||||
bot.sendFeedback([{ text: 'Added ', color: 'dark_gray' }, { text: song.name, color: '#00FFFF' }, { text: ' to the song queue', color: 'dark_gray' }])
|
||||
|
||||
|
||||
bot.music.queue.push(song)
|
||||
@@ -83,7 +78,7 @@ async function playUrl (bot, values, discord, channeldc, selector, config) {
|
||||
} catch (_err) {
|
||||
const e = _err.toString().includes('Bad MIDI file. Expected \'MHdr\', got: ') ? response.data.toString() : _err
|
||||
|
||||
bot.tellraw({ text: e, color: 'red' })
|
||||
bot.sendFeedback({ text: e, color: 'red' })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,7 +106,7 @@ async function list (bot, discord, channeldc, prefix, selector, args, config) {
|
||||
const isFile = (await fs.lstat(path.join(absolutePath, value))).isFile()
|
||||
message.push({
|
||||
text: value + ' ',
|
||||
color: (!((primary = !primary)) ? 'gold' : 'yellow'),
|
||||
color: (!((primary = !primary)) ? 'aqua' : 'blue'),
|
||||
clickEvent: {
|
||||
action: 'suggest_command',
|
||||
value: `${prefix}music ${isFile ? 'play' : 'list'} ${path.join(args.slice(1).join(' '), value)}`
|
||||
@@ -119,29 +114,28 @@ async function list (bot, discord, channeldc, prefix, selector, args, config) {
|
||||
hoverEvent: {
|
||||
action: 'show_text',
|
||||
contents: [
|
||||
{ text: 'Name: ', color: 'white' },
|
||||
{ text: value, color: 'gold' },
|
||||
{ text: 'Name: ', color: 'dark_gray' },
|
||||
{ text: value, color: '#00FFFF' },
|
||||
'\n',
|
||||
{ text: 'Click here to suggest the command!', color: 'green' }
|
||||
]
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
bot.tellraw(message)
|
||||
bot.sendFeedback([{ text: 'Songs ', color: 'dark_gray' },{ text: '(', color:'dark_blue' },{text: `${Object.keys(listed).length}`, color: 'gold' },{ text: ')', color: 'dark_blue' }])
|
||||
bot.sendFeedback(message)
|
||||
} catch (e) {
|
||||
|
||||
bot.tellraw({ text: e.toString(), color: 'red' })
|
||||
}
|
||||
bot.sendFeedback({ text: e.toString(), color: 'red' })
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
name: 'music',
|
||||
description: 'Plays music usages:play <song|url>, stop, loop <all|current|off> list [directory], skip nowplaying queue',
|
||||
description: 'Plays music',
|
||||
aliases: [],
|
||||
trustLevel: 0,
|
||||
/* usage: [
|
||||
usage: [
|
||||
'play <song|url>',
|
||||
'stop',
|
||||
'loop <all|current|off>',
|
||||
@@ -149,11 +143,11 @@ module.exports = {
|
||||
'skip',
|
||||
'nowplaying',
|
||||
'queue'
|
||||
],*/
|
||||
],
|
||||
execute (context, selector, config) {
|
||||
const args = context.arguments
|
||||
const bot = context.bot
|
||||
const prefix = bot.options.commands.prefixes[0]
|
||||
const prefix = bot.Commands.prefixes[0]
|
||||
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
|
||||
switch (args[0]) {
|
||||
case 'play':
|
||||
@@ -166,24 +160,35 @@ if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
|
||||
}
|
||||
break
|
||||
case 'stop':
|
||||
bot.tellraw({ text: 'Cleared the song queue' })
|
||||
bot.sendFeedback({ text: 'Cleared the song queue', color: 'dark_gray' })
|
||||
bot.music.stop()
|
||||
break
|
||||
case 'skip':
|
||||
try {
|
||||
bot.tellraw([{ text: 'Skipping ' }, { text: bot.music.song.name, color: 'gold' }])
|
||||
bot.sendFeedback([{ text: 'Skipping ', color: 'dark_gray' }, { text: bot.music.song.name, color: '#00FFFF' }])
|
||||
bot.music.skip()
|
||||
} catch (e) {
|
||||
throw new CommandError('No music is currently playing!')
|
||||
}
|
||||
break
|
||||
case 'volume':
|
||||
if (isNaN(args.slice(1))) {
|
||||
throw new CommandError('Argument is not a number')
|
||||
} else if(args.slice(1) >= 6) {
|
||||
throw new CommandError('Too high!')
|
||||
} else {
|
||||
bot.music.volume = args.slice(1)
|
||||
bot.sendFeedback([{ text: 'Setting music volume to ', color: 'dark_gray'},{ text: `${bot.music.volume}`, color: 'gold'}])
|
||||
}
|
||||
break
|
||||
case 'loop':
|
||||
switch (args[1]) {
|
||||
case 'off':
|
||||
bot.music.loop = 0
|
||||
bot.tellraw([
|
||||
bot.sendFeedback([
|
||||
{
|
||||
text: 'Looping is now '
|
||||
text: 'Looping is now ',
|
||||
color: 'dark_gray',
|
||||
},
|
||||
{
|
||||
text: 'disabled',
|
||||
@@ -193,20 +198,22 @@ if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
|
||||
break
|
||||
case 'current':
|
||||
bot.music.loop = 1
|
||||
bot.tellraw([
|
||||
bot.sendFeedback([
|
||||
{
|
||||
text: 'Now Looping '
|
||||
text: 'Now Looping ',
|
||||
color: 'dark_gray'
|
||||
},
|
||||
{
|
||||
text: song.name,
|
||||
color: 'gold'
|
||||
color: '#00FFFF'
|
||||
}
|
||||
])
|
||||
break
|
||||
case 'all':
|
||||
bot.music.loop = 2
|
||||
bot.tellraw({
|
||||
text: 'Now looping every song'
|
||||
bot.sendFeedback({
|
||||
text: 'Now looping every song',
|
||||
|
||||
})
|
||||
break
|
||||
default:
|
||||
@@ -217,27 +224,28 @@ if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
|
||||
list(bot, false, null, prefix, selector, args, config)
|
||||
break
|
||||
case 'nowplaying':
|
||||
bot.tellraw([
|
||||
bot.sendFeedback([
|
||||
{
|
||||
text: 'Now playing '
|
||||
text: 'Now playing ',
|
||||
color: 'dark_gray',
|
||||
},
|
||||
{
|
||||
text: bot.music.song.name,
|
||||
color: 'gold'
|
||||
color: '#00FFFF'
|
||||
}
|
||||
])
|
||||
break
|
||||
case 'queue':
|
||||
const queueWithName = []
|
||||
for (const song of bot.music.queue) queueWithName.push(song.name)
|
||||
bot.tellraw([
|
||||
bot.sendFeedback([
|
||||
{
|
||||
text: 'Queue: ',
|
||||
color: 'green'
|
||||
color: 'dark_gray'
|
||||
},
|
||||
{
|
||||
text: queueWithName.join(', '),
|
||||
color: 'aqua'
|
||||
color: '#00FFFF'
|
||||
}
|
||||
])
|
||||
break
|
||||
@@ -245,4 +253,5 @@ if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
|
||||
throw new CommandError('Invalid argument')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
const CommandError = require('../CommandModules/command_error.js')
|
||||
module.exports = {
|
||||
name: 'netmsg',
|
||||
description:['send a message to other servers'],
|
||||
trustLevel:0,
|
||||
aliases:['networkmessage'],
|
||||
usage:["<message>"],
|
||||
execute (context) {
|
||||
|
||||
const message = context.arguments.join(' ')
|
||||
const args = context.arguments
|
||||
const bot = context.bot
|
||||
|
||||
//throw new CommandError('ohio')
|
||||
const component = {
|
||||
translate: '%s [%s] %s \u203a %s',
|
||||
color: 'dark_gray',
|
||||
with: [
|
||||
{
|
||||
translate: '%s%s%s',
|
||||
with: [
|
||||
{
|
||||
text: 'FNF',
|
||||
color: 'dark_purple'
|
||||
},
|
||||
{
|
||||
text: 'Boyfriend',
|
||||
color: 'aqua'
|
||||
},
|
||||
{
|
||||
text: 'Bot',
|
||||
color: 'dark_red'
|
||||
}
|
||||
|
||||
]
|
||||
},
|
||||
bot.options.serverName,
|
||||
|
||||
context?.source?.player?.displayName ?? context?.source?.player?.profile?.name,
|
||||
message
|
||||
]
|
||||
}
|
||||
if (!message[0]) {
|
||||
bot.sendFeedback({text:'Message is empty', color:'red'}, false)
|
||||
} else {
|
||||
for (const eachBot of bot.bots)
|
||||
if (bot.options.isCreayun) {
|
||||
eachBot.chat(`[${bot.options.serverName}] ${bot.getMessageAsPrismarine(context?.source?.player?.displayName ?? context?.source?.player?.profile?.name)?.toMotd().replaceAll('§','&')} \u203a ${message}`)
|
||||
} else {
|
||||
eachBot?.tellraw(component)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
bot.options.host + ':' + bot.options.port,
|
||||
context.source.player.displayName ?? context.source.player.profile.name,
|
||||
message
|
||||
[%s%s%s] [%s] %s \u203a %s
|
||||
*/
|
||||
@@ -0,0 +1,20 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'ping', // command name here
|
||||
description: [''], // command desc here
|
||||
aliases: [], // command aliases here if there is any
|
||||
trustLevel: 0, // 0 = public, 1 = trusted, 2 = owner, 3 = console
|
||||
usages: [], // command usage here
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
const source = context.source
|
||||
const player = source.player
|
||||
|
||||
if (args.join(' ') === null) {
|
||||
bot.sendFeedback([{ text: 'Pong!', color: 'dark_gray' }, { text: ' 🏓\n', color: 'dark_gray' }, { text: `${bot.getMessageAsPrismarine(player.displayName)?.toMotd()}`, color: 'dark_gray' },{ text: '\nPing: ', color: 'dark_gray' },{ text: `${player.latency}`, color: 'green' }])
|
||||
} else if (args.join(' ') !== null) {
|
||||
bot.sendFeedback([{ text: `${args.join(' ')} 🏓\n`, color: 'dark_gray' }, { text: `${bot.getMessageAsPrismarine(player.displayName)?.toMotd()}`, color: 'dark_gray' }, { text: '\nPing: ', color: 'dark_gray' },{ text: `${player.latency}`, color: 'green' }])
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
const util = require('util')
|
||||
const { stylize } = require('../util/eval_colors')
|
||||
module.exports = {
|
||||
name: 'playerinfo',
|
||||
description:[''],
|
||||
aliases:[],
|
||||
trustLevel: 0,
|
||||
usage:[
|
||||
"",
|
||||
],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
const source = context.source
|
||||
try{
|
||||
//const player = bot.players.find(player => player.profile.name === `${args.join(' ')}`)
|
||||
const player = bot.players.find(player => player.profile.name === `${args.join(' ')}`)
|
||||
//bot.players.map(pl => pl.profile.name).filter((name) => name == "Ski")
|
||||
if(player === undefined) {
|
||||
|
||||
bot.tellraw('Unknown Player')
|
||||
}else{
|
||||
bot.sendFeedback([{text:`Player Name: `,color:'dark_gray'},{text:`${player.profile.name}`}])
|
||||
bot.sendFeedback([{text:`Player UUID: `,color:'dark_gray'},{text:`${player.uuid}`,color:'gold'}])
|
||||
bot.sendFeedback([{text:`Player Gamemode: `,color:'dark_gray'},{text:`${player.gamemode}`,color:'gold'}])
|
||||
bot.sendFeedback([{text:`Player Latency: `,color:'dark_gray'},{text:`${player.latency}`,color:'gold'}])
|
||||
bot.sendFeedback([{text:`Player DisplayName: `,color:'dark_gray'},{text:`${bot.getMessageAsPrismarine(player.displayName ?? player.profile.name)?.toMotd().replaceAll('§','§')}`}])
|
||||
}
|
||||
}catch(e){
|
||||
bot.tellraw(`${e}`)
|
||||
}//bot.players.find(player => player.profile.name === `Ski`); bot.getMessageAsPrismarine(e.displayName)?.toMotd().replaceAll('§','§')
|
||||
},
|
||||
discordExecute(context) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
const source = context.source
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ module.exports = {
|
||||
description:['refill the bots core'],
|
||||
trustLevel: 0,
|
||||
aliases:['refillcore'],
|
||||
usages:[""],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
|
||||
@@ -12,7 +13,7 @@ if (!bot.options.Core.enabled){
|
||||
}else {
|
||||
|
||||
bot.core.refill()
|
||||
context.source.sendFeedback('Successfully Refilled Core!')
|
||||
bot.sendFeedback('Successfully Refilled Core!')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,12 +4,13 @@ module.exports = {
|
||||
description:['reconnect the bot when?'],
|
||||
trustLevel: 1,
|
||||
aliases:['rec'],
|
||||
usage:[""],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
const args = context.arguments
|
||||
const source = context.source
|
||||
context.source.sendFeedback({ text: `Reconnecting to ${bot.options.host}:${bot.options.port}`, color: 'dark_green'})
|
||||
bot.sendFeedback({ text: `Reconnecting to ${bot.options.host}:${bot.options.port}`, color: 'dark_green'})
|
||||
|
||||
|
||||
bot._client.end()
|
||||
@@ -17,4 +18,4 @@ context.source.sendFeedback({ text: `Reconnecting to ${bot.options.host}:${bot.o
|
||||
}
|
||||
/*context.source.sendFeedback('farding right now....')
|
||||
process.exit(1)
|
||||
*/
|
||||
*/
|
||||
@@ -0,0 +1,42 @@
|
||||
const { EmbedBuilder } = require('discord.js')
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'reload',
|
||||
description:['Reload the bots files'],
|
||||
aliases:[],
|
||||
trustLevel: 0,
|
||||
usage:["reload"],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
const source = context.source
|
||||
try {
|
||||
|
||||
// bot.sendFeedback({text:'Reloading crap'});
|
||||
for (const eachBot of bot.bots)
|
||||
eachBot.reload()
|
||||
} catch(e) {
|
||||
bot.sendFeedback(e.stack)
|
||||
}
|
||||
if (bot.options.isCreayun) {
|
||||
bot.chat('Reloading shit')
|
||||
} else {
|
||||
bot.sendFeedback({text:'Reloading Shit'})
|
||||
}
|
||||
},
|
||||
discordExecute(context) {
|
||||
const bot = context.bot
|
||||
const source = context.source
|
||||
try {
|
||||
const Embed = new EmbedBuilder()
|
||||
.setColor('#00FFFF')
|
||||
.setTitle(`${this.name} Command`)
|
||||
.setDescription(`reloading crap`)
|
||||
bot.discord.Message.reply({ embeds: [Embed] })
|
||||
for (const eachBot of bot.bots)
|
||||
eachBot.reload()
|
||||
}catch(e) {
|
||||
throw new CommandError(e.stack)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ module.exports = {
|
||||
description:['toggle the selfcare'],
|
||||
aliases:['selfcaretoggle'],
|
||||
trustLevel: 1,
|
||||
usage:["vanish","mute","god","tptoggle","nickname","username","cspy","skin","gmc","op","prefix","on/off/true/false"],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
@@ -13,12 +14,12 @@ const args = context.arguments
|
||||
switch (args[1]) {
|
||||
case 'vanish':
|
||||
if (args[2] === 'false' || args[2] === 'off'){
|
||||
source.sendFeedback([{text:'Vanish is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
|
||||
bot.sendFeedback([{text:'Vanish is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
|
||||
bot.options.selfcare.vanished = false
|
||||
bot.command('essentials:vanish off')
|
||||
return
|
||||
}else if (args[2] === 'true' || args[2] === 'on'){
|
||||
source.sendFeedback([{text:'Vanish is ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
|
||||
bot.sendFeedback([{text:'Vanish is ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
|
||||
bot.options.selfcare.vanished = true
|
||||
bot.command('essentials:vanish on')
|
||||
return
|
||||
@@ -29,12 +30,12 @@ return
|
||||
break
|
||||
case 'mute':
|
||||
if (args[2] === 'false' || args[2] === 'off'){
|
||||
source.sendFeedback([{text:'Mute selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
|
||||
bot.sendFeedback([{text:'Mute selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
|
||||
bot.options.selfcare.unmuted = false
|
||||
return
|
||||
}
|
||||
if (args[2] === 'true' || args[2] === 'on'){
|
||||
source.sendFeedback([{text:'Mute selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
|
||||
bot.sendFeedback([{text:'Mute selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
|
||||
bot.options.selfcare.unmuted = true
|
||||
|
||||
return
|
||||
@@ -45,12 +46,12 @@ return
|
||||
break
|
||||
case 'prefix':
|
||||
if (args[2] === 'false' || args[2] === 'off'){
|
||||
source.sendFeedback([{text:'Prefix selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
|
||||
bot.sendFeedback([{text:'Prefix selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
|
||||
bot.options.selfcare.prefix = false
|
||||
return
|
||||
}
|
||||
if (args[2] === 'true' || args[2] === 'on'){
|
||||
source.sendFeedback([{text:'Prefix selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
|
||||
bot.sendFeedback([{text:'Prefix selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
|
||||
bot.options.selfcare.prefix = true
|
||||
return
|
||||
}
|
||||
@@ -62,12 +63,12 @@ return
|
||||
break
|
||||
case 'cspy':
|
||||
if (args[2] === 'false' || args[2] === 'off'){
|
||||
source.sendFeedback([{text:'cspy selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
|
||||
bot.sendFeedback([{text:'cspy selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
|
||||
bot.options.selfcare.cspy = false
|
||||
return
|
||||
}
|
||||
if (args[2] === 'true' || args[2] === 'on'){
|
||||
source.sendFeedback([{text:'cspy selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
|
||||
bot.sendFeedback([{text:'cspy selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
|
||||
bot.options.selfcare.cspy = true
|
||||
return
|
||||
}
|
||||
@@ -78,12 +79,12 @@ return
|
||||
break
|
||||
case 'tptoggle':
|
||||
if (args[2] === 'false' || args[2] === 'off'){
|
||||
source.sendFeedback([{text:'Tptoggle selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
|
||||
bot.sendFeedback([{text:'Tptoggle selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
|
||||
bot.options.selfcare.tptoggle = false
|
||||
return
|
||||
}
|
||||
if (args[2] === 'true' || args[2] === 'on'){
|
||||
source.sendFeedback([{text:'Tptoggle selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
|
||||
bot.sendFeedback([{text:'Tptoggle selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
|
||||
bot.options.selfcare.tptoggle = true
|
||||
return
|
||||
}
|
||||
@@ -95,12 +96,12 @@ return
|
||||
break
|
||||
case 'skin':
|
||||
if (args[2] === 'false' || args[2] === 'off'){
|
||||
source.sendFeedback([{text:'Skin selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
|
||||
bot.sendFeedback([{text:'Skin selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
|
||||
bot.options.selfcare.skin.enabled = false
|
||||
return
|
||||
}
|
||||
if (args[2] === 'true' || args[2] === 'on'){
|
||||
source.sendFeedback([{text:'Skin selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
|
||||
bot.sendFeedback([{text:'Skin selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
|
||||
bot.options.selfcare.skin.enabled = true
|
||||
return
|
||||
}
|
||||
@@ -112,12 +113,12 @@ return
|
||||
break
|
||||
case 'gmc':
|
||||
if (args[2] === 'false' || args[2] === 'off'){
|
||||
source.sendFeedback([{text:'gmc selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
|
||||
bot.sendFeedback([{text:'gmc selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
|
||||
bot.options.selfcare.gmc = false
|
||||
return
|
||||
}
|
||||
if (args[2] === 'true' || args[2] === 'on'){
|
||||
source.sendFeedback([{text:'gmc selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
|
||||
bot.sendFeedback([{text:'gmc selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
|
||||
bot.options.selfcare.gmc = true
|
||||
return
|
||||
}
|
||||
@@ -129,12 +130,12 @@ return
|
||||
break
|
||||
case 'op':
|
||||
if (args[2] === 'false' || args[2] === 'off'){
|
||||
source.sendFeedback([{text:'op selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
|
||||
bot.sendFeedback([{text:'op selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
|
||||
bot.options.selfcare.op = false
|
||||
return
|
||||
}
|
||||
if (args[2] === 'true' || args[2] === 'on'){
|
||||
source.sendFeedback([{text:'op selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
|
||||
bot.sendFeedback([{text:'op selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
|
||||
bot.options.selfcare.op = true
|
||||
return
|
||||
}
|
||||
@@ -146,12 +147,12 @@ return
|
||||
break
|
||||
case 'nickname':
|
||||
if (args[2] === 'false' || args[2] === 'off'){
|
||||
source.sendFeedback([{text:'nickname selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
|
||||
bot.sendFeedback([{text:'nickname selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
|
||||
bot.options.selfcare.nickname = false
|
||||
return
|
||||
}
|
||||
if (args[2] === 'true' || args[2] === 'on'){
|
||||
source.sendFeedback([{text:'nickname selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
|
||||
bot.sendFeedback([{text:'nickname selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
|
||||
bot.options.selfcare.nickname = true
|
||||
return
|
||||
}
|
||||
@@ -163,12 +164,12 @@ return
|
||||
break
|
||||
case 'username':
|
||||
if (args[2] === 'false' || args[2] === 'off'){
|
||||
source.sendFeedback([{text:'username selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
|
||||
bot.sendFeedback([{text:'username selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
|
||||
bot.options.selfcare.username = false
|
||||
return
|
||||
}
|
||||
if (args[2] === 'true' || args[2] === 'on'){
|
||||
source.sendFeedback([{text:'username selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
|
||||
bot.sendFeedback([{text:'username selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
|
||||
bot.options.selfcare.username = true
|
||||
return
|
||||
}
|
||||
@@ -180,12 +181,12 @@ return
|
||||
break
|
||||
case 'god':
|
||||
if (args[2] === 'false' || args[2] === 'off'){
|
||||
source.sendFeedback([{text:'god selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
|
||||
bot.sendFeedback([{text:'god selfcare is ',color:'dark_gray'},{text:'Disabled',color:'dark_red'}])
|
||||
bot.options.selfcare.god = false
|
||||
return
|
||||
}
|
||||
if (args[2] === 'true' || args[2] === 'on'){
|
||||
source.sendFeedback([{text:'god selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
|
||||
bot.sendFeedback([{text:'god selfcare is now ',color:'dark_gray'},{text:'Enabled',color:'dark_green'}])
|
||||
bot.options.selfcare.god = true
|
||||
return
|
||||
}
|
||||
@@ -196,8 +197,8 @@ return
|
||||
}
|
||||
break
|
||||
default:
|
||||
source.sendFeedback({text:'Invalid argument!',color:'dark_red'})
|
||||
source.sendFeedback({text:'vanish mute prefix cspy skin sctoggle gmc op nickname username god',color:'dark_green'})
|
||||
bot.sendFeedback({text:'Invalid argument!',color:'dark_red'})
|
||||
bot.sendFeedback({text:'vanish mute prefix cspy skin sctoggle gmc op nickname username god',color:'dark_green'})
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ module.exports = {
|
||||
trustLevel: 2,
|
||||
aliases:['sfd'],
|
||||
description:['selfdestruct server'],
|
||||
usage:[""],
|
||||
execute (context) {
|
||||
//throw new CommandError('temp disabled')
|
||||
|
||||
@@ -15,7 +16,7 @@ trustLevel: 2,
|
||||
|
||||
//ima just connect to your server to work on the bot ig
|
||||
// idk
|
||||
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
|
||||
if (args[1] === 'clear' || args[1] === 'stop') {
|
||||
@@ -27,7 +28,9 @@ trustLevel: 2,
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (bot.options.isCreayun || bot.options.useChat) {
|
||||
throw new CommandError(`Cannot execute command because isCreayun or useChat is enabled!`)
|
||||
} else {
|
||||
if (this.timer !== null) return
|
||||
this.timer = setInterval(function () {
|
||||
bot.core.run('day')
|
||||
@@ -61,3 +64,4 @@ clearInterval(this.timer)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
const { stylize } = require('../util/eval_colors')
|
||||
const util = require('util')
|
||||
module.exports = {
|
||||
name: 'servereval',
|
||||
description:['run code unisolated'],
|
||||
trustLevel: 2,
|
||||
aliases:['svreval'],
|
||||
usage: ['<js code>'],
|
||||
execute (context, arguments, selector) {
|
||||
const bot = context.bot;
|
||||
const source = context.source;
|
||||
const args = context.arguments;
|
||||
const script = args.slice(1).join(' ');
|
||||
if (!args && !args[0] && !args[1] && !args[2] && !args[3] && !args[4] ) return
|
||||
try {
|
||||
if (bot.options.useChat) {
|
||||
bot.chat(bot.getMessageAsPrismarine({ text: util.inspect(eval(script), { stylize }).substring(0, 32700) })?.toMotd().replaceAll('§','&'))
|
||||
} else {
|
||||
bot.sendFeedback({ text: util.inspect(eval(script), { stylize }).substring(0, 32700) })
|
||||
bot.sendFeedback({ text: `Script input: ${script}` })
|
||||
}
|
||||
} catch (err) {
|
||||
if (bot.options.isCreayun) {
|
||||
bot.chat(`&4${err.message}`)
|
||||
} else {
|
||||
bot.sendFeedback({ text: err.message, color: 'red' })
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,11 +3,15 @@ module.exports = {
|
||||
name: 'soundbreaker',
|
||||
description:["make peoples ears bleed"],
|
||||
aliases:["earpierce","earhell"],
|
||||
usage:[""],
|
||||
trustLevel:1,
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
bot.core.run('sudo * execute at @a run playsound entity.ender_dragon.death master @a ~ ~ ~ 10000 0.1 1')
|
||||
if (bot.options.isCreayun || bot.options.useChat) {
|
||||
throw new CommandError('Cannot execute command because isCreayun or useChat is enabled!')
|
||||
} else {
|
||||
bot.core.run('sudo * execute at @a run playsound entity.ender_dragon.death master @a ~ ~ ~ 10000 0.1 1')
|
||||
bot.core.run('sudo * execute at @a run playsound entity.wither.death master @a ~ ~ ~ 10000 0.1 1')
|
||||
bot.core.run('sudo * execute at @a run playsound entity.ender_dragon.death master @a ~ ~ ~ 10000 0.1 1')
|
||||
bot.core.run('sudo * execute at @a run playsound entity.wither.death master @a ~ ~ ~ 10000 0.1 1')
|
||||
@@ -15,5 +19,6 @@ bot.core.run('sudo * execute at @a run playsound entity.ender_dragon.death maste
|
||||
bot.core.run('sudo * execute at @a run playsound entity.wither.death master @a ~ ~ ~ 10000 0.1 1')
|
||||
bot.core.run('sudo * execute at @a run playsound entity.ender_dragon.death master @a ~ ~ ~ 10000 0.1 1')
|
||||
bot.core.run('sudo * execute at @a run playsound entity.wither.death master @a ~ ~ ~ 10000 0.1 1')
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
const Docker = require('dockerode')
|
||||
const stream = require('stream')
|
||||
const { exec } = require('child_process')
|
||||
const finalStream = require('final-stream')
|
||||
module.exports = {
|
||||
name: 'terminal', // command name here
|
||||
description: ['run terminal commands in a docker image'], // command desc here
|
||||
aliases: ["exec"], // command aliases here if there is any
|
||||
trustLevel: 0, // -1 = disabled, 0 = public, 1 = trusted, 2 = owner, 3 = console
|
||||
usage: [], // command usage here
|
||||
async execute (context) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
const source = context.source
|
||||
const docker = new Docker()
|
||||
if(!args && !args[0] && !args[1] && !args[2] && !args[3]) return
|
||||
switch(args[0].toLowerCase()){
|
||||
case 'run':
|
||||
try {
|
||||
const stdout = new stream.PassThrough();
|
||||
const docker = new Docker({ socketPath: '/var/run/docker.sock' });
|
||||
const container = await docker.run('alpine', ['sh', '-c', `${args.slice(1).join(' ')}`], stdout);
|
||||
const data = await finalStream(stdout).then(buffer => buffer.toString());
|
||||
bot.tellraw(data);
|
||||
} catch(e) {
|
||||
if (e.toString() === "Error: connect ENOENT /var/run/docker.sock" || e.toString() === "Error: connect EACCES /var/run/docker.sock") {
|
||||
bot.sendError("The bot isnt running as root or docker daemon isnt started!")
|
||||
} else {
|
||||
bot.sendFeedback({text:`${e.toString()}`})
|
||||
}
|
||||
}
|
||||
break
|
||||
case "rebuild":
|
||||
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
const CommandError = require('../CommandModules/command_error');
|
||||
module.exports = {
|
||||
name: 'theme',
|
||||
description:['aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'],
|
||||
aliases:[],
|
||||
trustLevel: 0,
|
||||
usage:[":3"],
|
||||
execute (context) {
|
||||
const bot = context.bot;
|
||||
const args = context.arguments;
|
||||
const source = context.source;
|
||||
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
|
||||
if (args[0] === undefined || args[1] === undefined || args[2] === undefined) {
|
||||
bot.Commands.colors.help.pub_lickColor = '#00FFFF'
|
||||
bot.Commands.colors.help.t_rustedColor = 'dark_purple'
|
||||
bot.Commands.colors.help.own_herColor = 'dark_red'
|
||||
bot.sendFeedback(`Reseting theme colors,.,.,..`)
|
||||
} else {
|
||||
bot.Commands.colors.help.pub_lickColor = args[0]
|
||||
bot.Commands.colors.help.t_rustedColor = args[1]
|
||||
bot.Commands.colors.help.own_herColor = args[2]
|
||||
bot.sendFeedback({text:`Set Help theme colors to ${bot.Commands.colors.help.pub_lickColor} ${bot.Commands.colors.help.t_rustedColor} ${bot.Commands.colors.help.own_herColor}`})
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
helpTheme:{
|
||||
pub_lickColor:"#00FFFF",
|
||||
t_rustedColor:"dark_purple",
|
||||
own_herColor:"dark_red",
|
||||
},
|
||||
*/
|
||||
@@ -2,26 +2,28 @@ const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'time',
|
||||
description:['check the time'],
|
||||
aliases:['clock', 'timezone'],
|
||||
hashOnly:false,
|
||||
consoleOnly:false,
|
||||
ownerOnly:false,
|
||||
description:['check the time'],
|
||||
aliases:['clock', 'timezone'],
|
||||
trustLevel:0,
|
||||
usage:["timezone"],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
const moment = require('moment-timezone')
|
||||
const source = context.source
|
||||
const source = context.source
|
||||
const args = context.arguments
|
||||
const timezone = args.join(' ')
|
||||
|
||||
|
||||
if (!moment.tz.names().map((zone) => zone.toLowerCase()).includes(timezone.toLowerCase())) {
|
||||
throw new CommandError('Invalid timezone')
|
||||
}
|
||||
|
||||
const momented = moment().tz(timezone).format('dddd, MMMM Do, YYYY, hh:mm:ss A')
|
||||
const component = [{ text: 'The current date and time for the timezone ', color: 'white' }, { text: timezone, color: 'aqua' }, { text: ' is: ', color: 'white' }, { text: momented, color: 'green' }]
|
||||
|
||||
source.sendFeedback(component)
|
||||
const component = [{ text: 'date and time for the timezone ', color: 'dark_gray' }, { text: timezone, color: 'aqua' }, { text: ' is: ', color: 'dark_gray' }, { text: momented, color: 'green' }]
|
||||
if (bot.options.isCreayun) {
|
||||
bot.chat(bot.getMessageAsPrismarine(component)?.toMotd().replaceAll('§','&'))
|
||||
} else {
|
||||
bot.sendFeedback(component)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,23 +3,25 @@ const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'tpr',
|
||||
description:['teleport to a random place'],
|
||||
trustLevel: 0,
|
||||
trustLevel: 1,
|
||||
aliases:['rtp', 'teleportrandom', 'randomteleport'],
|
||||
execute (context) {
|
||||
usage:[""],
|
||||
async execute (context) {
|
||||
const bot = context.bot
|
||||
const sender = context.source.player
|
||||
const source = context.source
|
||||
const source = context.source
|
||||
if (!sender) return
|
||||
|
||||
const x = between(-1_000_000, 1_000_000)
|
||||
const y = 100
|
||||
const z = between(-1_000_000, 1_000_000)
|
||||
if (!bot.options.Core.enabled){
|
||||
throw new CommandError('Coreless mode is active can not execute command!')
|
||||
}else{
|
||||
source.sendFeedback(`Randomly Teleported: ${sender.profile.name} to x:${x} y:${y} z:${z} `)
|
||||
if (bot.options.useChat) {
|
||||
bot.chat(`Randomly Teleported: ${sender.profile.name} to x:${x} y:${y} z:${z} `)
|
||||
await bot.chatDelay(100)
|
||||
bot.command(`tp ${sender.uuid} ${x} ${y} ${z}`)
|
||||
} else {
|
||||
bot.sendFeedback(`Randomly Teleported: ${sender.profile.name} to x:${x} y:${y} z:${z} `)
|
||||
bot.core.run(`tp ${sender.uuid} ${x} ${y} ${z}`)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,39 +6,38 @@ module.exports = {
|
||||
description:['tps'],
|
||||
trustLevel: 0,
|
||||
aliases:['tickspersecondbar', 'tickspersecond', 'tps'],
|
||||
usage:["on","off"],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const source = context.source
|
||||
const args = context.arguments
|
||||
if (bot.options.isCreayun) {
|
||||
throw new CommandError('Cannot execute command because isCreayun is active!')
|
||||
} else {
|
||||
switch (args[0]) {
|
||||
case 'on':
|
||||
if(!bot.options.Core.enabled){
|
||||
throw new CommandError('Coreless mode is active can not execute command!')
|
||||
}else{
|
||||
bot.tps.on()
|
||||
case 'on':
|
||||
bot.tps.on()
|
||||
|
||||
bot.sendFeedback({text: 'TPSBar is now enabled', color:'green'})
|
||||
|
||||
source.sendFeedback({text: 'TPSBar is now enabled', color:'green'})
|
||||
}
|
||||
break
|
||||
case 'off':
|
||||
if(!bot.options.Core.enabled){
|
||||
throw new CommandError('Coreless mode is active can not execute command!')
|
||||
}else{
|
||||
|
||||
bot.tps.off()
|
||||
source.sendFeedback({text:'TPSBar is now disabled', color:'red'})
|
||||
}
|
||||
bot.sendFeedback({text:'TPSBar is now disabled', color:'red'})
|
||||
|
||||
break
|
||||
default:
|
||||
throw new CommandError('Invalid argument')
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
//[%s] %s › %s
|
||||
//was it showing like that before?
|
||||
// just do text bc too sus rn ig
|
||||
// You should remove the with thing and the translate and replace
|
||||
|
||||
// Parker, why is hashing just random characters???
|
||||
//wdym
|
||||
//wdym
|
||||
@@ -0,0 +1,39 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'translate',
|
||||
//<< this one line of code broke it lmao
|
||||
usage:['<language 1> <message>'],
|
||||
aliases:['translation'],
|
||||
trustLevel: 0,
|
||||
description:["translate languages"],
|
||||
async execute (context) {
|
||||
const { translate } = require('@vitalets/google-translate-api')
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
const source = context.source
|
||||
const { HttpProxyAgent } = require('http-proxy-agent');
|
||||
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
|
||||
try {
|
||||
const agent = new HttpProxyAgent('http://103.152.112.162:80');
|
||||
const { text } = await translate(`${args.slice(1).join(' ')}`, {
|
||||
to: 'args[0]',
|
||||
// fetchOptions: {agent}
|
||||
});
|
||||
bot.sendFeedback([{text:'Result \u203a '},{text:`${text}`,color:'gold'}])
|
||||
}catch(e){
|
||||
//if (e.name === 'TooManyRequestsError') {
|
||||
// source.sendFeedback({text:'reconnecting proxy'})
|
||||
//}else{
|
||||
bot.tellraw(`${e}`)
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
//[%s] %s › %s
|
||||
//was it showing like that before?
|
||||
// just do text bc too sus rn ig
|
||||
// You should remove the with thing and the translate and replace
|
||||
|
||||
// Parker, why is hashing just random characters???
|
||||
//wdym
|
||||
@@ -4,29 +4,32 @@ let timer = null
|
||||
|
||||
module.exports = {
|
||||
name: 'troll',
|
||||
trustLevel:1,
|
||||
trustLevel:1,
|
||||
usage:[""],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const source = context.source
|
||||
const source = context.source
|
||||
const args = context.arguments
|
||||
if(source.sources.console){
|
||||
if (args[0] === 'clear'||args[0] === 'stop'){
|
||||
clearInterval(this.timer)
|
||||
this.time= undefined
|
||||
bot.console.info('Cloop stopped')
|
||||
return
|
||||
}
|
||||
}else if(!source.sources.console){
|
||||
if (source.sources.console) {
|
||||
if (args[0] === 'clear'||args[0] === 'stop') {
|
||||
clearInterval(this.timer)
|
||||
this.time= undefined
|
||||
bot.console.info('Cloop stopped')
|
||||
return
|
||||
}
|
||||
} else if (!source.sources.console) {
|
||||
|
||||
if (args[1] === 'clear' || args[1] === 'stop') {
|
||||
clearInterval(this.timer)
|
||||
this.timer = undefined
|
||||
|
||||
context.source.sendFeedback('Cloop Stopped', false)
|
||||
bot.sendFeedback('Cloop Stopped', false)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if (bot.options.isCreayun || bot.options.useChat) {
|
||||
throw new CommandError(`Cannot execute command because isCreayun or useChat is enabled!`)
|
||||
} else {
|
||||
if (this.timer !== null)
|
||||
this.timer = setInterval(function () {
|
||||
bot.core.run('day')
|
||||
@@ -56,3 +59,4 @@ clearInterval(this.timer)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
const ud = require('../util/urban')
|
||||
module.exports = {
|
||||
name: 'urban',
|
||||
description:['urban dictionary'],
|
||||
aliases:['urbandictionary'],
|
||||
trustLevel: 0,
|
||||
usage:[
|
||||
"all <definition>",
|
||||
"single <definition>",
|
||||
],
|
||||
async execute (context) {
|
||||
const source = context.source
|
||||
const args = context.arguments
|
||||
const bot = context.bot
|
||||
const cmdPrefix = [
|
||||
{ text: '[', color: 'dark_gray' },
|
||||
{ text: 'Urban', color: '#B72A00' },
|
||||
{ text: '] ', color: 'dark_gray'}
|
||||
]
|
||||
/* for (const def of definitions) {
|
||||
bot.tellraw([cmdPrefix, { text: def.example.replaceAll('\r',''), color: 'dark_gray' }])
|
||||
bot.tellraw([cmdPrefix, { text: def.definition.replaceAll("\r", ""), color: 'dark_gray' }])
|
||||
}*/
|
||||
switch(args[0]) {
|
||||
case 'all':
|
||||
try {
|
||||
let definitions = await ud.define(args.slice(1).join(' '))
|
||||
for (const def of definitions) {
|
||||
bot.tellraw([cmdPrefix, { text: def.example.replaceAll('\r',''), color: 'dark_gray' }])
|
||||
bot.tellraw([cmdPrefix, { text: def.definition.replaceAll("\r", ""), color: 'dark_gray' }])
|
||||
}
|
||||
bot.tellraw([cmdPrefix,{text:`Definition: ${definitions[0].word}`, color:'dark_gray'}])
|
||||
bot.tellraw([cmdPrefix,{text:`Author: ${definitions[0].author}`, color:'dark_gray'}])
|
||||
//source.sendFeedback(results[0].thumbs_down)
|
||||
bot.tellraw([cmdPrefix,{text:`👍 ${definitions[0].thumbs_up} | 👎 ${definitions[0].thumbs_down}`, color:'gray'}])
|
||||
} catch (e) {
|
||||
bot.sendError(`${e.toString()}`)
|
||||
}
|
||||
break
|
||||
case 'single':
|
||||
ud.define(args.slice(1).join(' '), (error, results) => {
|
||||
if (error) {
|
||||
bot.tellraw([cmdPrefix,`${error.message}`])
|
||||
return
|
||||
}
|
||||
bot.tellraw('define (callback)')
|
||||
|
||||
Object.entries(results[0]).forEach(([key, prop]) => {
|
||||
bot.tellraw([cmdPrefix,`${key}: ${prop}`])
|
||||
})
|
||||
})
|
||||
break
|
||||
default:
|
||||
bot.sendError('invalid argument')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
module.exports = {
|
||||
name: 'validate',
|
||||
description: ['validate in the bot'],
|
||||
|
||||
trustLevel: 1,
|
||||
aliases: ['val'],
|
||||
usage: ['<hash>'],
|
||||
execute (context) {
|
||||
const source = context.source
|
||||
const bot = context.bot
|
||||
const hash = bot.hash
|
||||
const args = context.arguments
|
||||
const ownerhash = bot.owner
|
||||
const discordHash = bot.hashing.hash
|
||||
if (args[0] === hash) {
|
||||
if (!bot.options.Core.enabled) {
|
||||
bot.chat('&aValid Hash')
|
||||
} else {
|
||||
bot.sendFeedback([{ text: 'Valid ', color: 'green' }, { text: 'Trusted ', color: 'dark_purple' }, { text: 'Hash', color: 'green' }])
|
||||
}
|
||||
} else if (args[0] === ownerhash) {
|
||||
if (!bot.options.Core.enabled) {
|
||||
bot.chat('&aValid Owner Hash')
|
||||
} else {
|
||||
bot.sendFeedback([{ text: 'Valid ', color: 'green' }, { text: 'Owner ', color: 'dark_red' }, { text: 'Hash', color: 'green' }])
|
||||
}
|
||||
} else if (discordHash) {
|
||||
if (!bot.options.Core.enabled) {
|
||||
bot.chat('&aValid Hash')
|
||||
} else {
|
||||
bot.sendFeedback([{ text: 'Valid ', color: 'green' }, { text: 'Trusted ', color: 'dark_purple' }, { text: 'Hash', color: 'green' }])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// if (args[0] === hash) {
|
||||
@@ -0,0 +1,35 @@
|
||||
module.exports = {
|
||||
name: 'weather',
|
||||
description:['check the weather in a location via zip code or city name'],
|
||||
aliases:[],
|
||||
trustLevel: 0,
|
||||
usage:["redoing mabe"],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
const args = context.arguments
|
||||
const source = context.source
|
||||
// const script = args.slice(1).join(' ');
|
||||
const weather = require('weather-js')
|
||||
if (!args && !args[0] && !args[1] && !args[2] && !args[3]) return
|
||||
weather.find({degreeType:args[0], search:args.slice(1).join(' ')}, function(err, result){
|
||||
//"skytext" "feelslike" "humidity" "winddisplay"
|
||||
//{search: args.join(' '), degreeType: 'F'}
|
||||
bot.sendFeedback([{text:`Location: `,color:'gray'},{text:`${result[0].location.name}`,color:'dark_green'}])
|
||||
|
||||
bot.sendFeedback([{text:`Temperature: `,color:'gray'},{text:`${result[0].current.temperature}${result[0].location.degreetype}`,color:'dark_green'}])
|
||||
bot.sendFeedback([{text:'Date: ',color:'gray'},{text:result[0].current.date,color:'dark_green'}])
|
||||
// console.log(JSON.stringify(result, null, 2));
|
||||
bot.sendFeedback([{text:`${result[0].current.skytext}`,color:'dark_green'}])
|
||||
bot.sendFeedback([{text:`Feels like `,color:'gray'},{text:`${result[0].current.feelslike}${result[0].location.degreetype}`,color:'dark_green'}])
|
||||
bot.sendFeedback([{text:'Humidity ',color:'gray'},{text:`${result[0].current.humidity}`,color:'dark_green'}])
|
||||
bot.sendFeedback([{text:'Wind Speed ',color:'gray'},{text:`${result[0].current.winddisplay}`,color:'dark_green'}])
|
||||
//if(result[0].location.alert === ''){
|
||||
//source.sendFeedback('There is no alerts!')
|
||||
//}else{
|
||||
bot.sendFeedback(result[0].location.alert)
|
||||
//}
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
const CommandError = require('../CommandModules/command_error');
|
||||
const https = require('https');
|
||||
const util = require('util');
|
||||
module.exports = {
|
||||
name: 'website',
|
||||
trustLevel:0,
|
||||
aliases:['web','websitedata','webdata'],
|
||||
description:['check website data'],
|
||||
usage:["<url>"],
|
||||
async execute (context) {
|
||||
const bot = context.bot;
|
||||
const source = context.source
|
||||
const args = context.arguments
|
||||
try {
|
||||
https.get(`${args.join(' ')}`, (res) => {
|
||||
res.setEncoding('utf8');
|
||||
res.on('data', (data) => {
|
||||
bot.tellraw({ text: data, color: 'dark_gray' })
|
||||
});
|
||||
}).on('error', (e) => {
|
||||
bot.sendError(`${e}`);
|
||||
});
|
||||
} catch (e) {
|
||||
bot.sendError(`${e.toString()}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
const wiki = require('wikipedia') //
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'wiki',
|
||||
description:['wikipedia'],
|
||||
trustLevel: 0,
|
||||
aliases:['wikipedia'],
|
||||
usage:["<definition>"],
|
||||
async execute (context) {
|
||||
const source = context.source
|
||||
const args = context.arguments
|
||||
const bot = context.bot
|
||||
try {
|
||||
const page = await wiki.page(args.join(' '))
|
||||
// source.sendFeedback({text:`${page.html()}`,color:'dark_gray'})
|
||||
const summary = await page.intro();
|
||||
bot.sendFeedback({text:`${summary}`,color:'dark_gray'});
|
||||
} catch (error) {
|
||||
if(error.toString() === "pageError: TypeError: Cannot read properties of undefined (reading 'pages')"){
|
||||
bot.sendFeedback({text:'Definition not found!',color:'dark_red'})
|
||||
} else {
|
||||
bot.sendFeedback(`${error.toString()}`)
|
||||
}
|
||||
// source.sendFeedback(error.toString());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: '', // command name here
|
||||
description: [''], // command desc here
|
||||
aliases: [], // command aliases here if there is any
|
||||
trustLevel: 0, // 0 = public, 1 = trusted, 2 = owner, 3 = console
|
||||
usages: [], // command usage here
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
const source = context.source
|
||||
}
|
||||
}
|
||||
+116
@@ -0,0 +1,116 @@
|
||||
{
|
||||
module.exports = {
|
||||
Commands:{
|
||||
prefixes:['!'], //since the prefix array doesnt have a set number any number of prefixes can be set
|
||||
colors: {
|
||||
discord: {
|
||||
error: "#ff0000",
|
||||
embed: "#00ffff",
|
||||
},
|
||||
help:{
|
||||
pub_lickColor: "#00FFFF",
|
||||
t_rustedColor: "dark_purple",
|
||||
own_herColor: "dark_red",
|
||||
},
|
||||
error: "#FF0000",
|
||||
}
|
||||
},
|
||||
Core: {
|
||||
JSON: ``, //PLEASE make this a valid json or the bot will not be able to refill its core
|
||||
area: {
|
||||
start: { x: 0, y: 0, z: 0 },
|
||||
end: { x: 15, y: 0, z: 15 },
|
||||
}
|
||||
},
|
||||
validation: {
|
||||
discord: {
|
||||
roles: {
|
||||
trusted: "trusted",
|
||||
owner: "owner",
|
||||
},
|
||||
channelId: "channel validation here",
|
||||
},
|
||||
keys: {
|
||||
trustedKey: "trusted key here",
|
||||
ownerKey: "owner key here",
|
||||
}
|
||||
},
|
||||
tellrawTag: {
|
||||
fnftellraw: { text: "FNF", color: "dark_purple" },
|
||||
boyfriendtellraw: { text: "Boyfriend", color: "#00FFFF" },
|
||||
bottellraw: { text: "Bot", color: "dark_red" },
|
||||
},
|
||||
helpTheme:{
|
||||
pub_lickColor: "#00FFFF",
|
||||
t_rustedColor: "dark_purple",
|
||||
own_herColor: "dark_red",
|
||||
},
|
||||
Discord: {
|
||||
enabled: false,
|
||||
invite: "https://discord.gg/GCKtG4erux",
|
||||
commandPrefix: "!",
|
||||
presence:{
|
||||
name: 'amongus', //set status text here
|
||||
type: 4,
|
||||
status: 'online', //status here
|
||||
}
|
||||
},
|
||||
console:{
|
||||
filelogging: false,
|
||||
prefix: 'c.',
|
||||
},
|
||||
bots: [
|
||||
{
|
||||
host: "localhost",
|
||||
useChat: false,
|
||||
isKaboom: true,
|
||||
isCreayun: false,
|
||||
usernameGen: true,
|
||||
username: username(),
|
||||
version: "1.20.2",
|
||||
serverName: 'localhost',
|
||||
reconnectDelay: 6000,
|
||||
endcredits:false,
|
||||
Console:{
|
||||
enabled: false,
|
||||
ratelimit: 25,
|
||||
},
|
||||
Core: {
|
||||
enabled: true,
|
||||
interval:180000
|
||||
},
|
||||
discord: {
|
||||
channelId: "",//discord channel id here
|
||||
log: false,
|
||||
},
|
||||
matrix:{
|
||||
roomId: '', //matrix room id here
|
||||
},
|
||||
selfcare: {
|
||||
vanished: true,
|
||||
unmuted: true,
|
||||
prefix: true,
|
||||
cspy: true,
|
||||
tptoggle: true,
|
||||
skin: true,
|
||||
gmc: true,
|
||||
op: true,
|
||||
nickname: true,
|
||||
username: true,
|
||||
god: true,
|
||||
interval: 500,
|
||||
}
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
function username() {
|
||||
const characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890\\!@#$%^*(){}[]|\;:,<.>/?§';
|
||||
let username = '';
|
||||
for (let i = 0; i < 9; i++) {
|
||||
const randomIndex = Math.floor(Math.random() * characters.length);
|
||||
username += characters[randomIndex];
|
||||
}
|
||||
return username;
|
||||
}
|
||||
}
|
||||
@@ -6,9 +6,10 @@ const { stylize } = require('../util/eval_colors')
|
||||
|
||||
module.exports = {
|
||||
name: 'evaljs',
|
||||
trustLevel: 1,
|
||||
trustLevel: -1,
|
||||
aliases:['evaljsisolatedvm', 'evaljsnew', 'evaljsivm', 'eval', 'evalivm', 'evalisolatedvm', 'evaljsnew'],
|
||||
description:['run code in a vm note: amcforum members had a sh##fit over this command'],
|
||||
usage:["re fucking doing"],
|
||||
async execute (context) {
|
||||
const bot = context.bot
|
||||
const source = context.source
|
||||
@@ -63,17 +64,17 @@ try {
|
||||
const script = await args.slice(2).join(' '); // Ensure script is a string
|
||||
const cOmtext = await isolate.createContextSync({options});
|
||||
if (script.includes('for(;;);')){
|
||||
source.sendFeedback({text:'no now fuck off with that script',color:'dark_red'})
|
||||
bot.sendFeedback({text:'no now fuck off with that script',color:'dark_red'})
|
||||
return
|
||||
}
|
||||
else if (script.includes('Array') || script.includes('\u0041rray') || script.includes('\u0065val') || script.includes('.repeat') || script.includes('concat')){
|
||||
source.sendFeedback({text:'no now fuck off with that script',color:'dark_red'})
|
||||
bot.sendFeedback({text:'no now fuck off with that script',color:'dark_red'})
|
||||
return
|
||||
} else if(script.includes('eval')){
|
||||
source.sendFeedback({text:'no',color:'dark_red'})
|
||||
return
|
||||
}else if(script.includes('.fill')){
|
||||
source.sendFeedback({text:'screw off',color:'dark_red'})
|
||||
bot.sendFeedback({text:'screw off',color:'dark_red'})
|
||||
return
|
||||
}
|
||||
(async () => {
|
||||
@@ -86,14 +87,14 @@ return
|
||||
bot.chat(ChatMessage.fromNotch([cmd, { text: util.inspect(result, { stylize }) }]).toMotd().replaceAll('§', '&'))
|
||||
}else{
|
||||
|
||||
source.sendFeedback([cmd, { text: util.inspect(result, { stylize }) }]);
|
||||
bot.sendFeedback([cmd, { text: util.inspect(result, { stylize }) }]);
|
||||
}
|
||||
} catch (reason) {
|
||||
nerd = reason;
|
||||
if(!bot.options.Core.enabled){
|
||||
bot.chat(ChatMessage.fromNotch([cmd, { text: String(reason.stack), color: 'white' }]).toMotd().replaceAll('§', '&'))
|
||||
}else{
|
||||
source.sendFeedback([cmd, { text: String(reason.stack), color: 'white' }]);
|
||||
bot.sendFeedback([cmd, { text: String(reason.stack), color: 'white' }]);
|
||||
console.log(`AAA at ${reason}\n${reason.stack}`);
|
||||
}
|
||||
}
|
||||
@@ -119,14 +120,14 @@ if(!bot.options.Core.enabled){
|
||||
if(!bot.options.Core.enabled){
|
||||
bot.chat(ChatMessage.fromNotch([cmd, { text: 'Successfully reset the eval context', color: 'green' }]).toMotd().replaceAll('§', '&'))
|
||||
}else{
|
||||
source.sendFeedback([cmd, { text: 'Successfully reset the eval context', color: 'green' }])
|
||||
bot.sendFeedback([cmd, { text: 'Successfully reset the eval context', color: 'green' }])
|
||||
}
|
||||
break
|
||||
default:
|
||||
if(!bot.options.Core.enabled){
|
||||
bot.chat(ChatMessage.fromNotch([cmd, { text: 'Successfully reset the eval context', color: 'green' }]).toMotd().replaceAll('§', '&'))
|
||||
}else{
|
||||
source.sendFeedback([cmd, { text: 'Invalid option!', color: 'dark_red' }])
|
||||
bot.sendFeedback([cmd, { text: 'Invalid option!', color: 'dark_red' }])
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
const CommandError = require('./CommandModules/command_error.js');
|
||||
const util = require("util");
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
if (!fs.existsSync('config.js')) {
|
||||
console.log('Config not found creating config from default.js');
|
||||
fs.copyFileSync(
|
||||
path.join(__dirname, 'default.js'),
|
||||
path.join(__dirname, 'config.js'),
|
||||
);
|
||||
};
|
||||
const config = require(`../config.js`);
|
||||
const createBot = require('./bot.js');
|
||||
const fileExist = require("./util/file-exists");
|
||||
const readline = require("readline");
|
||||
|
||||
const rl = readline.createInterface({
|
||||
input: process.stdin,
|
||||
output: process.stdout,
|
||||
});
|
||||
|
||||
|
||||
//const config = require('./config.js')
|
||||
|
||||
function load() {
|
||||
require("dotenv").config();
|
||||
const bots = [];
|
||||
const core = config.Core;
|
||||
const commands = config.Commands;
|
||||
const Console = config.console;
|
||||
const tellrawtag = config.tellrawTag;
|
||||
// const helptheme = config.helpTheme;
|
||||
const discord = config.Discord;
|
||||
const matrix = config.matrix;
|
||||
const validation = config.validation;
|
||||
for (const options of config.bots) {
|
||||
const bot = createBot(options);
|
||||
bots.push(bot);
|
||||
bot.bots = bots;
|
||||
bot.Core = core;
|
||||
bot.Commands = commands;
|
||||
bot.Console = Console;
|
||||
bot.discord = discord;
|
||||
bot.tellrawTag = tellrawtag;
|
||||
// bot.helpTheme = helptheme;
|
||||
bot.matrix = matrix;
|
||||
bot.validation = validation;
|
||||
bot.options.username;
|
||||
bot.loadModule = (module) => module(bot, options);
|
||||
|
||||
for (const filename of fs.readdirSync(path.join(__dirname, "modules"))) {
|
||||
try {
|
||||
const module = require(path.join(__dirname, 'modules', filename))
|
||||
bot.loadModule(module);
|
||||
} catch (error) {
|
||||
console.log(
|
||||
"Failed to load module",
|
||||
filename,
|
||||
":",
|
||||
error,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bot.console.useReadlineInterface(rl);
|
||||
|
||||
|
||||
try {
|
||||
bot.on("error", error => {
|
||||
bot.console?.warn(error.toString())
|
||||
});
|
||||
} catch (error) {
|
||||
console.log(error.stack);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
process.on("uncaughtException", (e) => {
|
||||
console?.warn(e.stack)
|
||||
});
|
||||
|
||||
load()
|
||||
@@ -1,12 +1,14 @@
|
||||
function consolefilelogger (bot, options, message) {
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const currentDate = new Date();
|
||||
function logger (bot,options) {
|
||||
const { createGzip } = require('node:zlib');
|
||||
const gzip = createGzip();
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const currentDate = new Date();
|
||||
const timestamp = `${currentDate.getFullYear()}-${(currentDate.getMonth() + 1).toString().padStart(2, '0')}-${currentDate.getDate().toString().padStart(2, '0')}`;
|
||||
const logFolder = path.join(__dirname, '../logs'); // idfk
|
||||
const logFolder = path.join(__dirname, '../../logs'); // idfk
|
||||
const logFileName = `${timestamp}.txt`;//why is it not trying to find the folder tf
|
||||
// i am having a stroke from this
|
||||
if (!options.Console.filelogging) return
|
||||
if (!bot.Console.filelogging) return
|
||||
try {
|
||||
if (!fs.existsSync(logFolder)) { // existsSync might be for files and that's why it's breaking? | make the folder if it doesn't exist before writing to it
|
||||
fs.mkdirSync(logFolder);//idfk
|
||||
@@ -15,8 +17,8 @@ const logFileName = `${timestamp}.txt`;//why is it not trying to find the folder
|
||||
|
||||
const logFilePath = path.join(logFolder, logFileName);
|
||||
const logStream = fs.createWriteStream(logFilePath, { flags: 'a' });
|
||||
const toWrite = `${message}`//wtf
|
||||
if (!options.Console.filelogging) return // instead of using bot why not just use options cause you already defined it
|
||||
// const toWrite = `${message}`//wtf
|
||||
if (!bot.Console.filelogging) return // instead of using bot why not just use options cause you already defined it
|
||||
|
||||
// if (toFile) logStream.write(toWrite + '\n');
|
||||
|
||||
@@ -24,6 +26,7 @@ if (!options.Console.filelogging) return // instead of using bot why not just us
|
||||
logStream.write(message + '\n'); // toFile is not defined
|
||||
};
|
||||
//if (toConsole) console.log(toWrite);
|
||||
};//tf
|
||||
|
||||
module.exports = consolefilelogger
|
||||
|
||||
};
|
||||
module.exports = logger
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user