mirror of
https://code.chipmunk.land/Parker2991/NitoriBot/
synced 2026-11-29 13:45:38 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1b9088c5fb | ||
|
|
632b271795 | ||
|
|
384e40fc64 | ||
|
|
d3cfdf1838 | ||
|
|
d1d4a44a62 | ||
|
|
06746a210b | ||
|
|
f3fe61717a | ||
|
|
6e87e6d54c | ||
|
|
7a99f51b16 | ||
|
|
59b0990234 | ||
|
|
b062c82561 | ||
|
|
22d57c061d | ||
|
|
7b724d9443 | ||
|
|
df406a4639 | ||
|
|
48ebbae30d | ||
|
|
cf0783f6c1 | ||
|
|
5b3ebd5566 | ||
|
|
0af3463910 | ||
|
|
381838d1f0 | ||
|
|
6649de3985 | ||
|
|
93602a3c80 | ||
|
|
beb439ff70 | ||
|
|
097fbb0eeb | ||
|
|
25519d5069 | ||
|
|
577c095d4a | ||
|
|
4623b5c31b | ||
|
|
3fa19cb658 | ||
|
|
8f6b539b2a | ||
|
|
552eb1ad81 | ||
|
|
e97845ca0c | ||
|
|
64864640f1 | ||
|
|
bbeb0e5e80 | ||
|
|
2c7a1baef0 | ||
|
|
df09e38075 | ||
|
|
f6a2a6bfe7 | ||
|
|
8b6ee277cc | ||
|
|
8a9c35d120 | ||
|
|
318ec20944 | ||
|
|
5b64fcba89 | ||
|
|
3c6477223a | ||
|
|
2e06642d9d | ||
|
|
315f5e9738 | ||
|
|
1ea411785c | ||
|
|
ff3d2cf0f2 | ||
|
|
fe677a08c3 | ||
|
|
69f2b3da17 | ||
|
|
f3b2d1208b | ||
|
|
2eba21a574 | ||
|
|
69172e1d72 | ||
|
|
09d257a0b4 | ||
|
|
4dfade48bb | ||
|
|
a581447b10 | ||
|
|
eedc5fece2 | ||
|
|
3cfcc0f568 | ||
|
|
0b49eb1e4f |
@@ -0,0 +1,147 @@
|
||||
const mc = require("minecraft-protocol");
|
||||
const { EventEmitter } = require("node:events");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const util = require("node:util");
|
||||
console.log(`Starting ${process.env["buildstring"]} .......`);
|
||||
console.log(`Foundation: ${process.env["FoundationBuildString"]}`);
|
||||
console.log("this may take a few moments....");
|
||||
require("events").EventEmitter.defaultMaxListeners = 30;
|
||||
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 ??= true;
|
||||
options.input ??= true;
|
||||
|
||||
options.commands.MainPrefix ??= "~";
|
||||
options.commands.SecondaryPrefix ??= "%";
|
||||
options.commands.TertiaryPrefix ??= "&";
|
||||
options.selfcare.unmuted ??= true;
|
||||
|
||||
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);
|
||||
});
|
||||
|
||||
client.on("login", async function (data) {
|
||||
bot.uuid = client.uuid;
|
||||
bot.username = client.username;
|
||||
bot.entityId = data.entityId;
|
||||
bot.host = bot.options.host;
|
||||
bot.port = bot.options.port;
|
||||
bot.buildstring = process.env["buildstring"];
|
||||
bot.fbs = process.env["FoundationBuildString"];
|
||||
bot.version = bot.options.version;
|
||||
console.log(`Username: ${bot.options.username}`);
|
||||
console.log(`Host: ${bot.options.host}:${bot.options.port}`);
|
||||
console.log(`Minecraft java version: ${bot.options.version}`);
|
||||
/* console.log(`Username: ${bot.username}`)
|
||||
console.log(`Host: ${bot.host}:${bot.port}`)
|
||||
console.log(`Minecraft java version: ${bot.version}`)*/
|
||||
});
|
||||
//reason, fullReason
|
||||
client.on("end", (reason) => {
|
||||
bot.emit("end", reason);
|
||||
console.log(reason);
|
||||
});
|
||||
client.on("disconnect", (reason) => {
|
||||
bot.emit("disconnect", reason);
|
||||
console.log(reason);
|
||||
});
|
||||
|
||||
client.on("kick_disconnect", (reason) => {
|
||||
bot.emit("kick_disconnect", reason);
|
||||
console.log(reason);
|
||||
});
|
||||
client.on("keep_alive", ({ keepAliveId }) => {
|
||||
bot.emit("keep_alive", { keepAliveId });
|
||||
// console.log(keepAliveId)
|
||||
});
|
||||
|
||||
client.on("error", (error) => bot.emit("error", error));
|
||||
|
||||
//client.end(reason, fullReason)
|
||||
});
|
||||
/*
|
||||
bot._client.on('kick_disconnect', (data) => {
|
||||
const parsed = JSON.parse(data.reason)
|
||||
bot.end(parsed, 'kick_disconnect')
|
||||
})
|
||||
|
||||
*/
|
||||
const buildstring = process.env["buildstring"];
|
||||
|
||||
const client = options.client ?? mc.createClient(options);
|
||||
bot._client = client;
|
||||
bot.emit("init_client", client);
|
||||
|
||||
bot.bots = options.bots ?? [bot];
|
||||
//bot.setMaxListeners(Infinity)
|
||||
//bot._client.setMaxListeners(Infinity)
|
||||
|
||||
// Modules
|
||||
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);
|
||||
//console.log(filename.length);
|
||||
} catch (error) {
|
||||
console.error(
|
||||
"\x1b[0m\x1b[91m[ERROR]: \x1b[0m\x1b[90mFailed to load module",
|
||||
filename,
|
||||
":",
|
||||
error,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return bot;
|
||||
} //path.join(__dirname, 'modules', filename)
|
||||
//path.join(amonger + 'FridayNightFunkinBoyfriendBot') !== path.join(amonger)
|
||||
//fs.stat
|
||||
const amonger = "../";
|
||||
if (fs.existsSync("../FridayNightFunkinBoyfriendBot") == false) {
|
||||
process.exit(1);
|
||||
}
|
||||
//path.join('') != fs. existsSync('~/FridayNightFunkinBoyfriendBot/index.js')
|
||||
|
||||
// ABot username function mabe mabe
|
||||
|
||||
module.exports = createBot;
|
||||
@@ -0,0 +1,74 @@
|
||||
const util = require('util')
|
||||
const createBot = require('./bot.js')
|
||||
//const chomensjs = require('./ChomensJS')
|
||||
// TODO: Load a default config
|
||||
const fs = require('fs/promises')
|
||||
const fileExist = require('./util/file-exists')
|
||||
const path = require('path')
|
||||
|
||||
function load () {
|
||||
//const config = require('./config.js')
|
||||
const readline = require('readline')
|
||||
|
||||
const rl = readline.createInterface({
|
||||
input: process.stdin,
|
||||
output: process.stdout,
|
||||
})
|
||||
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.console.useReadlineInterface(rl)
|
||||
|
||||
// bot.on('error', (error), util.inspect(error))
|
||||
|
||||
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.copyFile(path.join(__dirname, 'default.js'), path.join(__dirname, 'config.js'))
|
||||
} if (await fileExist(path.join(__dirname, 'config.js'))){
|
||||
console.log('Config found! loading config please wait,......')
|
||||
}
|
||||
|
||||
config = require('./config.js')
|
||||
load()
|
||||
}
|
||||
|
||||
checkConfig()
|
||||
|
||||
const modules = "./modules";
|
||||
const util = "./util";
|
||||
const CommandModules = "./CommandModules";
|
||||
const commands = "./commands";
|
||||
const chat = "./chat";
|
||||
fs.readdir(util, (err, files) => {
|
||||
console.log("Successfully loaded: " + files.length + " util files");
|
||||
});
|
||||
fs.readdir(modules, (err, files) => {
|
||||
console.log("Successfully loaded: " + files.length + " module files");
|
||||
});
|
||||
fs.readdir(commands, (err, files) => {
|
||||
console.log("Successfully loaded: " + files.length + " command files");
|
||||
});
|
||||
fs.readdir(CommandModules, (err, files) => {
|
||||
console.log("Successfully loaded: " + files.length + " CommandModule files");
|
||||
});
|
||||
fs.readdir(chat, (err, files) => {
|
||||
console.log("Successfully loaded: " + files.length + " chat files");
|
||||
});
|
||||
|
||||
process.on('uncaughtException', (e) => {
|
||||
console.log('uncaught ' + e.stack)
|
||||
})
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
class CommandSource {
|
||||
constructor (player, sources, hash, owner, discordMessageEvent = null, consoleOnly, name, profile, bot) {//this worked just fine in v4.3.4
|
||||
//does it get defined in discord thingy wherever dat is
|
||||
// sus
|
||||
|
||||
this.player = player
|
||||
|
||||
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
|
||||
@@ -12,14 +11,15 @@ class CommandSource {
|
||||
this.owner = owner
|
||||
this.consoleOnly = consoleOnly
|
||||
this.discordMessageEvent = discordMessageEvent
|
||||
this.prefix = prefix
|
||||
|
||||
|
||||
}
|
||||
|
||||
sendFeedback () {}
|
||||
|
||||
sendError (message) {
|
||||
this.sendFeedback([{ text: '', color: 'red' }, message], false)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,176 +1,122 @@
|
||||
const mc = require('minecraft-protocol')
|
||||
const { EventEmitter } = require('node:events')
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const util = require('node:util')
|
||||
console.log(`Starting ${process.env["buildstring"]} .......`)
|
||||
console.log(`Foundation: ${process.env["FoundationBuildString"]}`)
|
||||
console.log('this may take a few moments....')
|
||||
require('events').EventEmitter.defaultMaxListeners = 20;
|
||||
function createBot(options = {}) {
|
||||
const bot = new EventEmitter()
|
||||
const rs = require('randomstring')
|
||||
const mc = require("minecraft-protocol");
|
||||
const { EventEmitter } = require("node:events");
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const util = require("node:util");
|
||||
console.log(`Starting ${process.env["buildstring"]} .......`);
|
||||
console.log(`Foundation: ${process.env["FoundationBuildString"]}`);
|
||||
console.log("this may take a few moments....");
|
||||
require("events").EventEmitter.defaultMaxListeners = 31;
|
||||
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 ??= true
|
||||
options.input ??= true
|
||||
//options.logger ??= true
|
||||
// MainPrefix: "~",
|
||||
// SecondaryPrefix:'%',
|
||||
//TertiaryPrefix:'@'
|
||||
|
||||
options.commands.MainPrefix ??= '!'
|
||||
options.commands.SecondaryPrefix ??= '!'
|
||||
options.commands.TertiaryPrefix ??= '!'
|
||||
options.selfcare.unmuted ??= true
|
||||
|
||||
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.Core.core ??= true
|
||||
|
||||
|
||||
|
||||
options.discord.commandPrefix ??= '!'
|
||||
|
||||
options.reconnectDelay ??= 1000
|
||||
|
||||
options.Core.customName ??= '@'
|
||||
|
||||
options.selfcare.username ??= true
|
||||
|
||||
options.selfcare.nickname ??= true
|
||||
|
||||
options.selfcare.god ??= true
|
||||
|
||||
options.selfcare.tptoggle ??= true
|
||||
bot.options = 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.commands.MainPrefix ??= "~";
|
||||
options.commands.SecondaryPrefix ??= "%";
|
||||
options.commands.TertiaryPrefix ??= "&";
|
||||
options.selfcare.unmuted ??= true;
|
||||
*/
|
||||
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)
|
||||
})
|
||||
bot.on("init_client", (client) => {
|
||||
client.on("packet", (data, meta) => {
|
||||
bot.emit("packet", data, meta);
|
||||
bot.emit("packet." + meta.name, data);
|
||||
});
|
||||
|
||||
client.on('login', async function (data) {
|
||||
|
||||
bot.uuid = client.uuid
|
||||
bot.username = client.username
|
||||
bot.entityId = data.entityId
|
||||
bot.host = bot.options.host
|
||||
bot.port = bot.options.port
|
||||
bot.buildstring = process.env['buildstring']
|
||||
bot.fbs = process.env['FoundationBuildString']
|
||||
bot.version = bot.options.version
|
||||
console.log(`Username: ${bot.options.username}`)
|
||||
console.log(`Host: ${bot.options.host}:${bot.options.port}`)
|
||||
console.log(`Minecraft java version: ${bot.options.version}`)
|
||||
/* console.log(`Username: ${bot.username}`)
|
||||
console.log(`Host: ${bot.host}:${bot.port}`)
|
||||
console.log(`Minecraft java version: ${bot.version}`)*/
|
||||
})
|
||||
//reason, fullReason
|
||||
client.on('end', reason => { bot.emit('end', reason)
|
||||
console.log(reason)
|
||||
|
||||
})
|
||||
client.on('disconnect', reason => {
|
||||
bot.emit('disconnect', reason)
|
||||
console.log(reason)
|
||||
})
|
||||
|
||||
client.on('kick_disconnect', reason => {
|
||||
bot.emit('kick_disconnect', reason)
|
||||
console.log(reason)
|
||||
})
|
||||
client.on('keep_alive', ({ keepAliveId }) => {
|
||||
bot.emit('keep_alive', { keepAliveId })
|
||||
// console.log(keepAliveId)
|
||||
})
|
||||
|
||||
client.on('error', error => bot.emit('error', error), )
|
||||
|
||||
//client.end(reason, fullReason)
|
||||
|
||||
})
|
||||
/*
|
||||
bot._client.on('kick_disconnect', (data) => {
|
||||
const parsed = JSON.parse(data.reason)
|
||||
bot.end(parsed, 'kick_disconnect')
|
||||
})
|
||||
|
||||
*/
|
||||
const buildstring = process.env['buildstring']
|
||||
|
||||
const client = options.client ?? mc.createClient(options)
|
||||
bot._client = client
|
||||
bot.emit('init_client', client)
|
||||
|
||||
bot.bots = options.bots ?? [bot]
|
||||
//bot.setMaxListeners(Infinity)
|
||||
//bot._client.setMaxListeners(Infinity)
|
||||
|
||||
// Modules
|
||||
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)
|
||||
//console.log(filename.length);
|
||||
} catch (error) {
|
||||
|
||||
console.error('\x1b[0m\x1b[91m[ERROR]: \x1b[0m\x1b[90mFailed to load module', filename, ':', error)
|
||||
client.on("login", async function (data) {
|
||||
bot.uuid = client.uuid;
|
||||
bot.username = client.username;
|
||||
bot.port = bot.options.port;
|
||||
bot.version = bot.options.version;
|
||||
|
||||
}
|
||||
}
|
||||
console.log(`Username: ${bot.options.username}`);
|
||||
console.log(`Host: ${bot.options.host}:${bot.options.port}`);
|
||||
console.log(`Minecraft java version: ${bot.options.version}`);
|
||||
if(!bot.options.Core.enabled){
|
||||
bot.console.info(`Coreless mode active for ${bot.options.host}:${bot.options.port} !`)
|
||||
}
|
||||
bot.chat('&5&lFNF�FFFF&lBoyfriend&4&lBot &f- &4Parker&02991')
|
||||
|
||||
//startupmsg:true,
|
||||
|
||||
const timer = setInterval(() => {
|
||||
bot.chat(`Join the FNFBoyfriendBot discord ${bot.options.discord.invite}`)
|
||||
}, 280000)
|
||||
|
||||
client.on("end", (reason) => {
|
||||
bot.emit("end", reason);
|
||||
console.log(reason);
|
||||
bot.cloop.clear()
|
||||
bot.memusage.off()
|
||||
clearInterval(timer)
|
||||
});
|
||||
});
|
||||
client.on("disconnect", (reason) => {
|
||||
bot.emit("disconnect", reason);
|
||||
console.log(reason);
|
||||
});
|
||||
|
||||
client.on("kick_disconnect", (reason) => {
|
||||
bot.emit("kick_disconnect", reason);
|
||||
console.log(reason);
|
||||
});
|
||||
client.on("keep_alive", ({ keepAliveId }) => {
|
||||
bot.emit("keep_alive", { keepAliveId });
|
||||
});
|
||||
|
||||
client.on("error", (error) => bot.emit("error", error));
|
||||
});
|
||||
|
||||
|
||||
return bot
|
||||
}//path.join(__dirname, 'modules', filename)
|
||||
//path.join(amonger + 'FridayNightFunkinBoyfriendBot') !== path.join(amonger)
|
||||
//fs.stat
|
||||
const amonger = '../'
|
||||
if (fs.existsSync('../FridayNightFunkinBoyfriendBot') == false) {
|
||||
process.exit(1)
|
||||
}
|
||||
//path.join('') != fs. existsSync('~/FridayNightFunkinBoyfriendBot/index.js')
|
||||
const client = options.client ?? mc.createClient(options);
|
||||
bot._client = client;
|
||||
bot.emit("init_client", client);
|
||||
|
||||
const modules = './modules';
|
||||
const util2 = './util';
|
||||
const CommandModules = './CommandModules';
|
||||
const commands = './commands';
|
||||
const chat = './chat'
|
||||
fs.readdir(util2, (err, files) => {
|
||||
console.log('Successfully loaded: ' + files.length + ' util files');
|
||||
});
|
||||
fs.readdir(modules, (err, files) => {
|
||||
console.log('Successfully loaded: ' + files.length + ' module files');
|
||||
});
|
||||
fs.readdir(commands, (err, files) => {
|
||||
console.log('Successfully loaded: ' + files.length + ' command files');
|
||||
});
|
||||
fs.readdir(CommandModules, (err, files) => {
|
||||
console.log('Successfully loaded: ' + files.length + ' CommandModule files');
|
||||
});
|
||||
fs.readdir(chat, (err, files) => {
|
||||
console.log('Successfully loaded: ' + files.length + ' chat files');
|
||||
});
|
||||
bot.bots = options.bots ?? [bot];
|
||||
|
||||
// ABot username function mabe mabe
|
||||
|
||||
module.exports = createBot
|
||||
|
||||
|
||||
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;
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
function parseMessage (messageobj, data) { // this function is not getting called
|
||||
const ChatMessage = require('prismarine-chat')('1.20.1')
|
||||
const stringify = message => new ChatMessage(message).toString()
|
||||
const message = stringify(messageobj);
|
||||
var pattern = /^(.*?) (\S*?) » (.*?)$/;
|
||||
// var pattern = /^(.*?) (\S*?) \u203a (.*?)$/;
|
||||
//console.log('[debug] parsing a message');
|
||||
const match = message.match(pattern);
|
||||
if(pattern.test(message)) {
|
||||
// console.log('[debug]', match);
|
||||
return { sender: match[2], contents: match[3], type: 'minecraft:chat'}; //
|
||||
} else {
|
||||
//console.log('[debug] pattern does not match');
|
||||
}//i just realized that the bot uses tellraw
|
||||
//ima try to fix that
|
||||
}//it picks players up as undefined in creayun
|
||||
//and i tried using the kaboom chat parser but edited and that didnt work
|
||||
// [] username »
|
||||
module.exports = parseMessage//:troll:
|
||||
// •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
|
||||
// function(function(function(function(function(function(function(function(function(function(function(function(function(function(function(function)))))))))))))))
|
||||
// i guess so because it connects you
|
||||
// i think?
|
||||
//🐔💨💩😎🐒🥶😁😂⏰❌🐒🛏
|
||||
//very real
|
||||
// theres so much things that get logged :sob:
|
||||
//gotta love when it refuses to connect
|
||||
// someones trying to be fake me in kaboom
|
||||
//the bot is being waaay to sus
|
||||
// i will crash him when i get on // sus // very
|
||||
//k
|
||||
// getting the fake parker out of kaboom
|
||||
// pcrashed
|
||||
@@ -1,15 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'botdevhistory',
|
||||
description:['bots dev history'],
|
||||
|
||||
trustLevel: 0,
|
||||
execute (context) {
|
||||
|
||||
const message = context.arguments.join(' ')
|
||||
const bot = context.bot
|
||||
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!')
|
||||
}
|
||||
}
|
||||
+261
-196
@@ -1,244 +1,309 @@
|
||||
// TODO: Maybe add more authors
|
||||
// TODO: Maybe add more authors
|
||||
const bots = [
|
||||
{
|
||||
name: { text: 'HBot', color: 'aqua', bold:false },
|
||||
authors: ['hhhzzzsss'],
|
||||
exclaimer:'HBOT HARRYBUTT LMAOOOOOOOOOOOOOOOOO',
|
||||
foundation: 'java/mcprotocollib',
|
||||
prefixes: ['#']
|
||||
name: { text: "HBot", color: "aqua", bold: false },
|
||||
authors: ["hhhzzzsss"],
|
||||
exclaimer: "HBOT HARRYBUTT LMAOOOOOOOOOOOOOOOOO",
|
||||
foundation: "java/mcprotocollib",
|
||||
prefixes: ["#"],
|
||||
},
|
||||
{
|
||||
name: { text: '64Bot', color: 'gold', bold:false },
|
||||
authors: ['64Will64'],
|
||||
exclaimer:'NINTENDO 64?!?!??!?! 69Bot when??????',
|
||||
foundation: 'NodeJS/Mineflayer',
|
||||
prefixes: ['w=']
|
||||
name: { text: "64Bot", color: "gold", bold: false },
|
||||
authors: ["64Will64"],
|
||||
exclaimer: "NINTENDO 64?!?!??!?! 69Bot when??????",
|
||||
foundation: "NodeJS/Mineflayer",
|
||||
prefixes: ["w="],
|
||||
},
|
||||
{
|
||||
name: { text: 'Nebulabot', color: 'dark_purple', bold:false },
|
||||
authors: ['IuCC'],
|
||||
exclaimer:'the void',
|
||||
foundation: 'NodeJS/Node-minecraft-protocol',
|
||||
prefixes: ['[']
|
||||
name: { text: "Nebulabot", color: "dark_purple", bold: false },
|
||||
authors: ["IuCC"],
|
||||
exclaimer: "the void",
|
||||
foundation: "NodeJS/Node-minecraft-protocol",
|
||||
prefixes: ["["],
|
||||
},
|
||||
{
|
||||
name: { text: 'SharpBot', color: 'aqua', bold:false },
|
||||
authors: ['64Will64'],
|
||||
exclaimer:'sharp as in the tv? idfk im out of jokes also the first c# bot on the list??',
|
||||
foundation: 'C#/MineSharp',
|
||||
prefixes: ['s=']
|
||||
name: [
|
||||
{ text: "Prism", color: "#00FF9C", bold: true },
|
||||
{ text: "Bot", color: "white",bold:true },
|
||||
],
|
||||
authors: ["IuCC"],
|
||||
exclaimer: "prismarine :3",
|
||||
foundation: "NodeJS/Node-minecraft-protocol",
|
||||
prefixes: ["["],
|
||||
},
|
||||
{
|
||||
name: { text: "SharpBot", color: "aqua", bold: false },
|
||||
authors: ["64Will64"],
|
||||
exclaimer:
|
||||
"sharp as in the tv? idfk im out of jokes also the first c# bot on the list??",
|
||||
foundation: "C#/MineSharp",
|
||||
prefixes: ["s="],
|
||||
},
|
||||
|
||||
{
|
||||
name: { text: 'MoonBot', color: 'red', bold:false },
|
||||
authors: ['64Will64'],
|
||||
exclaimer:'stop mooning/mooing me ',
|
||||
foundation: 'NodeJS/Mineflayer',
|
||||
prefixes: ['m=']
|
||||
name: { text: "MoonBot", color: "red", bold: false },
|
||||
authors: ["64Will64"],
|
||||
exclaimer: "stop mooning/mooing me ",
|
||||
foundation: "NodeJS/Mineflayer",
|
||||
prefixes: ["m="],
|
||||
},
|
||||
{
|
||||
name: { text: 'TableBot', color: 'yellow', bold:false },
|
||||
authors: ['12alex12'],
|
||||
exclaimer:'TABLE CLOTH BOT?!?! ',
|
||||
foundation: 'NodeJS/Node-minecraft-protocol',
|
||||
prefixes: ['t!']
|
||||
name: { text: "TableBot", color: "yellow", bold: false },
|
||||
authors: ["12alex12"],
|
||||
exclaimer: "TABLE CLOTH BOT?!?! ",
|
||||
foundation: "NodeJS/Node-minecraft-protocol",
|
||||
prefixes: ["t!"],
|
||||
},
|
||||
{
|
||||
name: [{ text: 'Evil', color: 'dark_red', bold:false }, {text:'Bot', color:'dark_purple'}],
|
||||
authors: ['FusseligerDev'],
|
||||
exclaimer:'',
|
||||
foundation: 'Java/Custom',
|
||||
prefixes: ['!']
|
||||
name: [
|
||||
{ text: "Evil", color: "dark_red", bold: false },
|
||||
{ text: "Bot", color: "dark_purple" },
|
||||
],
|
||||
authors: ["FusseligerDev"],
|
||||
exclaimer: "",
|
||||
foundation: "Java/Custom",
|
||||
prefixes: ["!"],
|
||||
},
|
||||
{
|
||||
name: { text: 'SBot Java', color: 'white', bold:false }, // TODO: Gradient
|
||||
authors: ['evkc'],
|
||||
foundation: 'Java/MCProtocolLib',
|
||||
prefixes: [':']
|
||||
},
|
||||
{
|
||||
name: { text: 'SBot Rust', color: 'white', bold:false}, // TODO: Gradient
|
||||
authors: ['evkc'],
|
||||
foundation: 'Rust',
|
||||
prefixes: ['re:']
|
||||
},
|
||||
{
|
||||
name: { text: 'Z-Boy-Bot', color: 'dark_purple', bold:false }, // TODO: Gradient
|
||||
exclaimer: 'Most likely skidded along with kbot that the dev used',
|
||||
authors: ['Romnci'],
|
||||
foundation: 'NodeJS/mineflayer or Java/mcprotocollib idfk',
|
||||
prefixes: ['Z]']
|
||||
},
|
||||
{
|
||||
name: { text: 'ABot', color: 'gold', bold:true }, // TODO: Gradient
|
||||
exclaimer: 'not used anymore (replaced by V2)',
|
||||
authors: [{text: '_yfd', color: 'light_purple'}],
|
||||
foundation: 'NodeJS/Node-Minecraft-Protocol',
|
||||
prefixes: ['<']
|
||||
name: { text: "SBot Java", color: "white", bold: false }, // TODO: Gradient
|
||||
authors: ["evkc"],
|
||||
foundation: "Java/MCProtocolLib",
|
||||
prefixes: [":"],
|
||||
},
|
||||
{
|
||||
name: { text: 'ABot-V2', color: 'gold', bold:true }, // TODO: Gradient
|
||||
exclaimer: '',
|
||||
authors: [{text: '_yfd', color: 'light_purple'}],
|
||||
foundation: 'NodeJS/Node-Minecraft-Protocol',
|
||||
prefixes: ['<']
|
||||
name: { text: "SBot Rust", color: "white", bold: false }, // TODO: Gradient
|
||||
authors: ["evkc"],
|
||||
foundation: "Rust",
|
||||
prefixes: ["re:"],
|
||||
},
|
||||
{
|
||||
name: { text: 'FardBot', color: 'light_purple', bold:false },
|
||||
authors: ['_yfd'],
|
||||
exclaimer: 'bot is dead lol',
|
||||
foundation: 'NodeJS/Mineflayer',
|
||||
prefixes: ['<']
|
||||
},
|
||||
|
||||
{
|
||||
name: { text: 'ChipmunkBot', color: 'green', bold:false },
|
||||
authors: ['_ChipMC_'],
|
||||
exclaimer: 'chips? also shoutout to chip and chayapak for helping in the rewrite',
|
||||
|
||||
foundation: 'Java/MCProtocolLib',
|
||||
prefixes: ["'", "/'"]
|
||||
name: { text: "Z-Boy-Bot", color: "dark_purple", bold: false }, // TODO: Gradient
|
||||
exclaimer: "Most likely skidded along with kbot that the dev used",
|
||||
authors: ["Romnci"],
|
||||
foundation: "NodeJS/mineflayer or Java/mcprotocollib idfk",
|
||||
prefixes: ["Z]"],
|
||||
},
|
||||
{
|
||||
name: { text: 'ChipmunkBot Old', color: 'green', bold:false },
|
||||
authors: ['_ChipMC_'],
|
||||
foundation: 'NodeJS/Node-Minecraft-Protocol',
|
||||
|
||||
},
|
||||
{
|
||||
name: { text: 'TestBot', color: 'aqua', bold:false },
|
||||
authors: ['Blackilykat'],
|
||||
foundation: 'Java/MCProtocolLib',
|
||||
prefixes: ["-"]
|
||||
},
|
||||
{
|
||||
name: { text: 'UBot', color: 'grey', bold:false },
|
||||
authors: ['HexWoman'],
|
||||
exclaimer: 'UwU OwO',
|
||||
|
||||
foundation: 'NodeJS/node-minecraft-protocol',
|
||||
prefixes: ['"']
|
||||
name: { text: "ABot", color: "gold", bold: true }, // TODO: Gradient
|
||||
exclaimer: "not used anymore (replaced by V2)",
|
||||
authors: [{ text: "_yfd", color: "light_purple" }],
|
||||
foundation: "NodeJS/Node-Minecraft-Protocol",
|
||||
prefixes: ["<"],
|
||||
},
|
||||
{
|
||||
name: { text: 'ChomeNS Bot Java', color: 'yellow', bold:false},
|
||||
authors: ['chayapak'],
|
||||
exclaimer: 'wow its my bot !! ! 4374621q43567%^&#%67868-- chayapak',
|
||||
foundation: 'Java/MCProtocolLib',
|
||||
prefixes: ['*', 'cbot ', '/cbot ']
|
||||
name: { text: "ABot-V2", color: "gold", bold: true }, // TODO: Gradient
|
||||
exclaimer: "",
|
||||
authors: [{ text: "_yfd", color: "light_purple" }],
|
||||
foundation: "NodeJS/Node-Minecraft-Protocol",
|
||||
prefixes: ["<"],
|
||||
},
|
||||
{
|
||||
name: { text: "FardBot", color: "light_purple", bold: false },
|
||||
authors: ["_yfd"],
|
||||
exclaimer: "bot is dead lol",
|
||||
foundation: "NodeJS/Mineflayer",
|
||||
prefixes: ["<"],
|
||||
},
|
||||
{
|
||||
name: { text: 'ChomeNS Bot NodeJS', color: 'yellow', bold:false},
|
||||
authors: ['chayapak'],
|
||||
|
||||
foundation: 'NodeJS/Node-Minecraft-Protocol',
|
||||
prefixes: ['*', 'cbot', '/cbot']
|
||||
},
|
||||
{
|
||||
name: { text: 'RecycleBot', color: 'dark_green', bold:false},
|
||||
foundation: ['MorganAnkan'],
|
||||
exclaimer: 'nice bot',
|
||||
language: 'NodeJS/node-minecraft-protocol',
|
||||
prefixes: ['=']
|
||||
},
|
||||
{
|
||||
name: { text: 'ManBot', color: 'dark_green' , bold:false },
|
||||
exclaimer: '(more like men bot :skull:) OH HAAAAAAAAAAAAAAIIILL LOGINTIMEDOUT',
|
||||
authors: ['Man/LogintimedOut'],
|
||||
foundation: 'NodeJS/mineflayer',
|
||||
prefixes: ['(Note:I dont remember!!)']
|
||||
},
|
||||
{
|
||||
name: [{ text: 'Useless', color: 'red', bold:false}, { text: 'Bot', color: 'gray', bold:false}],
|
||||
exclaimer: 'it isnt useless its a good bot................',
|
||||
authors: ['IuCC'],
|
||||
foundation: 'NodeJS/node-minecraft-protocol',
|
||||
prefixes: ['[']
|
||||
},
|
||||
{
|
||||
name: [{ text: 'Blurry', color: 'dark_purple' , bold:false}, { text: 'Bot', color: 'red' }],
|
||||
exclaimer: '',
|
||||
authors: ['SirLennox'],
|
||||
foundation: 'Java/custom',
|
||||
prefixes: [',']
|
||||
},
|
||||
{
|
||||
name: [{ text: 'SnifferBot', color: 'gold' , bold:false}],
|
||||
exclaimer: 'sniff sniff',
|
||||
authors: ['Seasnail8169'],
|
||||
foundation: 'NodeJS/Node-minecraft-protocol',
|
||||
prefixes: ['>']
|
||||
},
|
||||
{
|
||||
name: [{ text: 'KittyCorp', color: 'yellow', bold:false }, { text: 'Bot', color: 'yellow' }],
|
||||
exclaimer: '3 words ginlang is gay',
|
||||
authors: ['ginlang , G6_, ArrayBuffer, and i guess more??'],
|
||||
foundation: 'NodeJS/node-minecraft-protocol',
|
||||
prefixes: ['^']
|
||||
},
|
||||
|
||||
{
|
||||
name: [{ text:'FNF', color: 'dark_purple', bold: false}, {text:'Boyfriend', color: 'aqua', bold:false}, {text:'Bot', color:'dark_red', bold:false}, {text:' Node-Minecraft-Protocol', color:'black', bold:false}],
|
||||
authors: [{ text:'Parker2991', color: 'dark_red'}, {text:' _ChipMC_', color: 'dark_green', bold:false}, {text:' chayapak', color:'yellow', bold:false}, {text:' _yfd', color:'light_purple', bold:false}],
|
||||
exclaimer: 'FNFBoyfriendBot NMP Rewrite',
|
||||
foundation: 'NodeJS/node-minecraft-protocol',
|
||||
prefixes: ['~']
|
||||
},
|
||||
{
|
||||
name: [{ text:'FNF', color: 'dark_purple', bold: false}, {text:'Boyfriend', color: 'aqua', bold:false}, {text:'Bot', color:'dark_red', bold:false}, {text:' Mineflayer', color:'green', bold:false}],
|
||||
authors: [{text:'Parker2991', color:'dark_red' }, {text:' _ChipMC_', color:'dark_green', bold:false }],
|
||||
exclaimer:'1037 LINES OF CODE WTFARD!??! also this version is in console commands only' ,
|
||||
foundation: 'NodeJS/mineflayer',
|
||||
prefixes: []
|
||||
}
|
||||
]
|
||||
name: { text: "ChipmunkBot Java", color: "green", bold: false },
|
||||
authors: ["_ChipMC_"],
|
||||
exclaimer:
|
||||
"chips? also shoutout to chip and chayapak for helping in the rewrite",
|
||||
|
||||
foundation: "Java/MCProtocolLib",
|
||||
prefixes: ["'", "/'"],
|
||||
},
|
||||
{
|
||||
name: { text: "ChipmunkBot NodeJS", color: "green", bold: false },
|
||||
authors: ["_ChipMC_"],
|
||||
foundation: "NodeJS/Node-Minecraft-Protocol",
|
||||
},
|
||||
{
|
||||
name: { text: "TestBot", color: "aqua", bold: false },
|
||||
authors: ["Blackilykat"],
|
||||
foundation: "Java/MCProtocolLib",
|
||||
prefixes: ["-"],
|
||||
},
|
||||
{
|
||||
name: { text: "UBot", color: "grey", bold: false },
|
||||
authors: ["HexWoman"],
|
||||
exclaimer: "UwU OwO",
|
||||
|
||||
foundation: "NodeJS/node-minecraft-protocol",
|
||||
prefixes: ['"'],
|
||||
},
|
||||
{
|
||||
name: { text: "ChomeNS Bot Java", color: "yellow", bold: false },
|
||||
authors: ["chayapak"],
|
||||
exclaimer: "wow its my bot !! ! 4374621q43567%^&#%67868-- chayapak",
|
||||
foundation: "Java/MCProtocolLib",
|
||||
prefixes: ["*", "cbot ", "/cbot "],
|
||||
},
|
||||
{
|
||||
name: { text: "ChomeNS Bot NodeJS", color: "yellow", bold: false },
|
||||
authors: ["chayapak"],
|
||||
|
||||
foundation: "NodeJS/Node-Minecraft-Protocol",
|
||||
prefixes: ["*", "cbot", "/cbot"],
|
||||
},
|
||||
{
|
||||
name: { text: "RecycleBot", color: "dark_green", bold: false },
|
||||
foundation: ["MorganAnkan"],
|
||||
exclaimer: "nice bot",
|
||||
language: "NodeJS/node-minecraft-protocol",
|
||||
prefixes: ["="],
|
||||
},
|
||||
{
|
||||
name: { text: "neobot", color: "blue", bold: false },
|
||||
exclaimer: "n e o b o t ;oslkdfj;salkdfj;ladsjf",
|
||||
authors: ["mirkokral"],
|
||||
foundation: "java/MCProtocolLib",
|
||||
prefixes: ["_"],
|
||||
},
|
||||
{
|
||||
name: { text: "ManBot", color: "dark_green", bold: false },
|
||||
exclaimer:
|
||||
"(more like men bot :skull:) OH HAAAAAAAAAAAAAAIIILL LOGINTIMEDOUT",
|
||||
authors: ["Man/LogintimedOut"],
|
||||
foundation: "NodeJS/mineflayer",
|
||||
prefixes: ["(Note:I dont remember!!)"],
|
||||
},
|
||||
{
|
||||
name: [
|
||||
{ text: "Useless", color: "red", bold: false },
|
||||
{ text: "Bot", color: "gray", bold: false },
|
||||
],
|
||||
exclaimer: "it isnt useless its a good bot................",
|
||||
authors: ["IuCC"],
|
||||
foundation: "NodeJS/node-minecraft-protocol",
|
||||
prefixes: ["["],
|
||||
},
|
||||
{
|
||||
name: [
|
||||
{ text: "Blurry", color: "dark_purple", bold: false },
|
||||
{ text: "Bot", color: "red" },
|
||||
],
|
||||
exclaimer: "",
|
||||
authors: ["SirLennox"],
|
||||
foundation: "Java/custom",
|
||||
prefixes: [","],
|
||||
},
|
||||
{
|
||||
name: [{ text: "SnifferBot", color: "gold", bold: false }],
|
||||
exclaimer: "sniff sniff FNFBoyfriendBot simp",
|
||||
authors: ["popbob"],
|
||||
foundation: "NodeJS/Node-minecraft-protocol",
|
||||
prefixes: [">"],
|
||||
},
|
||||
{
|
||||
name: [{ text: "XBot", color: "dark_purple", bold: false }],
|
||||
exclaimer: "",
|
||||
authors: ["popbob"],
|
||||
foundation: "ts-Node/Node-minecraft-protocol",
|
||||
prefixes: ["$"],
|
||||
},
|
||||
{
|
||||
name: [
|
||||
{ text: "Kitty", color: "gold", bold: false },{text:"Corp", color:'aqua',bold:false},
|
||||
{ text: "Bot", color: "yellow",bold:false },
|
||||
],
|
||||
exclaimer: "3 words ginlang is gay",
|
||||
authors: ["ginlang , G6_, ArrayBuffer, and i guess more??"],
|
||||
foundation: "NodeJS/node-minecraft-protocol",
|
||||
prefixes: ["^"],
|
||||
},
|
||||
|
||||
{
|
||||
name: [
|
||||
{ text: "FNF", color: "dark_purple", bold: false },
|
||||
{ text: "Boyfriend", color: "aqua", bold: false },
|
||||
{ text: "Bot", color: "dark_red", bold: false },
|
||||
{ text: " nmp", color: "black", bold: false },
|
||||
],
|
||||
authors: [
|
||||
{ text: "Parker2991", color: "dark_red" },
|
||||
{ text: " _ChipMC_", color: "dark_green", bold: false },
|
||||
{ text: " chayapak", color: "yellow", bold: false },
|
||||
{ text: " _yfd", color: "light_purple", bold: false },
|
||||
{ text: "popbob", color: "gold" },
|
||||
],
|
||||
exclaimer: "FNFBoyfriendBot NMP Rewrite",
|
||||
foundation: "NodeJS/node-minecraft-protocol",
|
||||
prefixes: ["~ % &"],
|
||||
},
|
||||
{
|
||||
name: [
|
||||
{ text: "FNF", color: "dark_purple", bold: false },
|
||||
{ text: "Boyfriend", color: "aqua", bold: false },
|
||||
{ text: "Bot", color: "dark_red", bold: false },
|
||||
{ text: " legacy", color: "green", bold: false },
|
||||
],
|
||||
authors: [
|
||||
{ text: "Parker2991", color: "dark_red" },
|
||||
{ text: " _ChipMC_", color: "dark_green", bold: false },
|
||||
],
|
||||
exclaimer:
|
||||
"1037 LINES OF CODE WTFARD!??! also this version is in console commands only",
|
||||
foundation: "NodeJS/mineflayer",
|
||||
prefixes: [],
|
||||
},
|
||||
];
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'bots',
|
||||
description:['shows a list of known bots'],
|
||||
aliases:['knownbots'],
|
||||
trustLevel: 0,
|
||||
execute (context) {
|
||||
const query = context.arguments.join(' ').toLowerCase()
|
||||
const bot = context.bot
|
||||
name: "bots",
|
||||
description: ["shows a list of known bots"],
|
||||
aliases: ["knownbots"],
|
||||
trustLevel: 0,
|
||||
execute(context) {
|
||||
const query = context.arguments.join(" ").toLowerCase();
|
||||
const bot = context.bot;
|
||||
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)
|
||||
list.push(info.name)
|
||||
|
||||
if (list.length !== 0) list.push({ text: ", ", color: "gray" }); // list.push(info.name)
|
||||
list.push(info.name);
|
||||
}
|
||||
|
||||
context.source.sendFeedback(['Known bots (', bots.length, ') - ', ...list], false)
|
||||
return
|
||||
context.source.sendFeedback(
|
||||
["Known bots (", bots.length, ") - ", ...list],
|
||||
false,
|
||||
);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for (const info of bots) {
|
||||
const plainName = String(context.bot.getMessageAsPrismarine(info.name)).toLowerCase()
|
||||
if (plainName.includes(query)) this.sendBotInfo(info, context.bot)
|
||||
const plainName = String(
|
||||
context.bot.getMessageAsPrismarine(info.name),
|
||||
).toLowerCase();
|
||||
if (plainName.includes(query)) this.sendBotInfo(info, context.bot);
|
||||
}
|
||||
},
|
||||
|
||||
sendBotInfo (info, bot) {
|
||||
const component = ['']
|
||||
component.push('Name: ', info.name)
|
||||
if (info.exclaimer) component.push('\n', 'Exclaimer: ', info.exclaimer)
|
||||
sendBotInfo(info, bot) {
|
||||
const component = [""];
|
||||
component.push("Name: ", info.name);
|
||||
if (info.exclaimer) component.push("\n", "Exclaimer: ", info.exclaimer);
|
||||
if (info.authors && info.authors.length !== 0) {
|
||||
component.push('\n', 'Authors: ')
|
||||
component.push("\n", "Authors: ");
|
||||
for (const author of info.authors) {
|
||||
component.push(author, { text: ', ', color: 'gray' })
|
||||
component.push(author, { text: ", ", color: "gray" });
|
||||
}
|
||||
component.pop()
|
||||
component.pop();
|
||||
}
|
||||
if (info.foundation) component.push('\n', 'Foundation: ', info.foundation)
|
||||
if (info.foundation) component.push("\n", "Foundation: ", info.foundation);
|
||||
if (info.prefixes && info.prefixes.length !== 0) {
|
||||
component.push('\n', 'Prefixes: ')
|
||||
component.push("\n", "Prefixes: ");
|
||||
for (const prefix of info.prefixes) {
|
||||
component.push(prefix, { text: ', ', color: 'gray' })
|
||||
component.push(prefix, { text: ", ", color: "gray" });
|
||||
}
|
||||
component.pop()
|
||||
component.pop();
|
||||
}
|
||||
bot.tellraw([component])
|
||||
}
|
||||
}//it doing it just for the ones i added lol
|
||||
bot.tellraw([component]);
|
||||
},
|
||||
};
|
||||
//it doing it just for the ones i added lol
|
||||
// prob a replit moment, it probably thinks there are regexes in the strings
|
||||
|
||||
+15
-1
@@ -29,11 +29,25 @@ const bots = [
|
||||
exclaimer:'fixed the issue with the cpu checking in the info command added discord hashing back into the bot to work along side the keys made it check to see if the config file is in the directory and if not it will recreate the config from default.js',
|
||||
},
|
||||
{//
|
||||
name: { text: 'v5.0.3', color: 'gray', bold:false },
|
||||
name: { text: 'v5.0.3', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '12/29/23',
|
||||
exclaimer:'mabe the bot last update of 2023 cuz next year will be 2024 www but anyway expanded the disconnect messages for both console and discord but thats pretty much it',
|
||||
},
|
||||
{//
|
||||
name: { text: 'v5.0.4', color: 'green', bold:false },
|
||||
authors: [''],
|
||||
|
||||
foundation: '1/12/24',
|
||||
exclaimer:'first update of 2024 for the bot but anyway merged the test and errortest commands into cmdtest, changed the colors for the help command public is #00FFFF, trusted is dark_purple and owner remained as dark red. moved the module loader from bot.js to index.js to split the boot time in half which now allows module functions like bot.chat() to be used in bot.js and also since the command manager is a module it also loads the commands thats a w on all ends also removed some modules to improve the bots boot time and moved the functions for the sctoggle command into the command itself and not as a module which helped the boot time as well and last but not least merged the memused usage in the info command with the serverinfo usage and made the memusage command use the bossbar and not the actionbar',
|
||||
},
|
||||
{//
|
||||
name: { text: 'v5.0.5', color: 'dark_red', bold:false },
|
||||
authors: ['§#f001dbQT §#740000KB §0Termination'],
|
||||
|
||||
foundation: '1/26/24',
|
||||
exclaimer:'added a new feature to the bot called Coreless Mode to where the core can be toggled and most commands using tellraw will use chat instead along with the discord relay chat, fixed the bug with trust and owner commands not running in console along with removing alot of useless commands and made the 3 prefixes a array and added ratelimit for console logging and command usage and added file chat logging back',
|
||||
},
|
||||
]//
|
||||
//back
|
||||
|
||||
+15
-7
@@ -1,4 +1,4 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'cloop',
|
||||
//hashOnly: true,
|
||||
@@ -7,20 +7,26 @@ module.exports = {
|
||||
trustLevel: 1,
|
||||
description:['command loop commands, the args are add, remove, clear, and list'],
|
||||
aliases:['commandloop'],
|
||||
execute (context, selector) {
|
||||
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)
|
||||
|
||||
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({
|
||||
@@ -28,7 +34,8 @@ module.exports = {
|
||||
color:'green',
|
||||
with: [ command, interval ]
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
break
|
||||
case 'remove':
|
||||
if (parseInt(args[2]) === NaN) source.sendFeedback({ text: 'Invalid index', color: 'red' }, false)
|
||||
@@ -78,11 +85,12 @@ module.exports = {
|
||||
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' })
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
const CommandSource = require('../CommandModules/command_source')
|
||||
module.exports = {
|
||||
name: 'cmdtest',
|
||||
description:['usages are test and msg error'],
|
||||
trustLevel: 0,
|
||||
aliases:['cmdtst', 'commandtest', 'commandtst'],
|
||||
execute (context) {
|
||||
|
||||
const bot = context.bot
|
||||
|
||||
const player = context.source.player.profile.name
|
||||
const uuid = context.source.player.uuid
|
||||
const message = context.arguments.join(' ') // WHY SECTION SIGNS!!
|
||||
const args = context.arguments
|
||||
const source = context.source
|
||||
switch (args[0]) {
|
||||
case 'msg':
|
||||
const component = {
|
||||
translate: '[%s] %s %s %s %s %s',
|
||||
with: [
|
||||
{
|
||||
translate: '%s%s%s',
|
||||
bold:false,
|
||||
with: [
|
||||
{
|
||||
text: 'FNF',
|
||||
bold: true,
|
||||
color: 'dark_purple'
|
||||
|
||||
},
|
||||
{
|
||||
text: 'Boyfriend',
|
||||
bold: true,
|
||||
color: 'aqua'
|
||||
},
|
||||
{
|
||||
text: 'Bot',
|
||||
bold: true,
|
||||
color: 'dark_red'
|
||||
},
|
||||
],
|
||||
clickEvent: bot.options.Core.customName ? { action: 'open_url', value: bot.options.Core.customName } : undefined,
|
||||
hoverEvent: { action: 'show_text', contents: `idfk what to put here` }
|
||||
},
|
||||
{
|
||||
text:'Hello, World!,'
|
||||
},{
|
||||
text:'Player:'
|
||||
},
|
||||
|
||||
|
||||
context.source.player.displayName ?? context.source.player.profile.name,
|
||||
{
|
||||
text:`, uuid: ${uuid ?? context.source.player.uuid } , `
|
||||
},
|
||||
//entry.displayName
|
||||
{text:`Argument: ${args.slice(1).join(' ')}`}
|
||||
]//command.split(' ')[0]
|
||||
}//context.source.player.displayName ?? context.source.player.profile.name
|
||||
|
||||
//ChatMessage.fromNotch(`${process.env["buildstring"]}`).toMotd().replaceAll('§', '&')
|
||||
|
||||
if (!bot.options.Core.enabled){
|
||||
const ChatMessage = require('prismarine-chat')(bot.options.version)
|
||||
bot.chat(`Hello, World!, Player: ${ChatMessage.fromNotch(context.source.player.displayName ?? context.source.player.profile.name).toMotd().replaceAll('§', '&')}, uuid: ${context.source.player.uuid}, Argument: ${args.slice(1).join(' ')}`)
|
||||
|
||||
} else {
|
||||
bot.tellraw([component])
|
||||
}
|
||||
/*
|
||||
const bot = context.bot
|
||||
|
||||
const player = context.source.player.profile.name
|
||||
const uuid = context.source.player.uuid
|
||||
const message = context.arguments.join(' ') // WHY SECTION SIGNS!!
|
||||
|
||||
context.source.sendFeedback(`Hello, World!, Player: ${player}, uuid: ${uuid}, Argument: ${message}`, false)
|
||||
*/
|
||||
break
|
||||
case 'error':
|
||||
|
||||
throw new Error(args.slice(1).join(' '))
|
||||
|
||||
break
|
||||
function sleep(ms) {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}
|
||||
default:
|
||||
if (bot.options.Core.CorelessMode){
|
||||
bot.chat('&4Invalid action')
|
||||
sleep(500)
|
||||
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 }])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
|
||||
*/
|
||||
//context.source.player.displayName ?? context.source.player.profile.name,
|
||||
+1
-1
@@ -13,7 +13,7 @@ const bot = context.bot
|
||||
|
||||
const prefix = {
|
||||
translate: '[%s] %s \u203a %s',
|
||||
color:'gray',
|
||||
color:'dark_gray',
|
||||
with: [
|
||||
{
|
||||
text: 'FNFBoyfriendBot Console', color:'#00FFFF'
|
||||
|
||||
+4
-1
@@ -16,6 +16,9 @@ module.exports = {
|
||||
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
|
||||
@@ -23,6 +26,6 @@ if (message.startsWith('/')) {
|
||||
bot.core.run(message)
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
-3
@@ -10,8 +10,13 @@ trustLevel: 1,
|
||||
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
|
||||
switch (args[1]) {
|
||||
|
||||
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}`)
|
||||
@@ -34,13 +39,17 @@ const args = context.arguments
|
||||
{ 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
-1
@@ -10,7 +10,7 @@ module.exports = {
|
||||
const args = context.arguments
|
||||
const source = context.source
|
||||
source.sendFeedback(`${bot.username} fell out of the world`)
|
||||
process.exit('amongus')
|
||||
process.exit()
|
||||
}
|
||||
}
|
||||
/*context.source.sendFeedback('farding right now....')
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'errortest',
|
||||
description:['test errors'],
|
||||
aliases:['error', 'errtest', 'errtst'],
|
||||
trustLevel: 0,
|
||||
execute (context) {
|
||||
const message = context.arguments.join(' ')
|
||||
//context.source.sendFeedback('hint hover your mouse over the error')
|
||||
throw new Error(message)
|
||||
|
||||
}
|
||||
}
|
||||
+25
-7
@@ -14,6 +14,7 @@ trustLevel: 1,
|
||||
const source = context.source
|
||||
const args = context.arguments
|
||||
const util = require('util')
|
||||
const ChatMessage = require('prismarine-chat')(bot.options.version)
|
||||
const cmd = {
|
||||
translate: '[%s] ',
|
||||
bold: false,
|
||||
@@ -69,18 +70,29 @@ try {
|
||||
timeout: 1000
|
||||
})
|
||||
nerd = result;
|
||||
source.sendFeedback([cmd, { text: util.inspect(result, { stylize }) }]);
|
||||
if(!bot.options.Core.enabled){
|
||||
bot.chat(ChatMessage.fromNotch([cmd, { text: util.inspect(result, { stylize }) }]).toMotd().replaceAll('§', '&'))
|
||||
}else{
|
||||
source.sendFeedback([cmd, { text: util.inspect(result, { stylize }) }]);
|
||||
}
|
||||
} catch (reason) {
|
||||
nerd = reason;
|
||||
source.sendFeedback([cmd, { text: String(reason.stack), color: 'white' }]);
|
||||
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' }]);
|
||||
console.log(`AAA at ${reason}\n${reason.stack}`);
|
||||
}
|
||||
}
|
||||
})();
|
||||
} catch (reason) {
|
||||
source.sendFeedback([cmd, { text: String("UwU OwO ewwor" + reason.stack), color: 'white' }]);
|
||||
if(!bot.options.Core.enabled){
|
||||
bot.chat(ChatMessage.fromNotch([cmd, { text: String("UwU OwO ewwor" + reason.stack), color: 'white' }]).toMotd().replaceAll('§', '&'))
|
||||
}else{
|
||||
source.sendFeedback([cmd, { text: String("UwU OwO ewwor" + reason.stack), color: 'white' }]);
|
||||
console.log(`AAA at ${reason}\n${reason.stack}`);
|
||||
}
|
||||
|
||||
}
|
||||
// credits to chatgpt because im lazy mabe mabe? idfk again ty
|
||||
//
|
||||
break//
|
||||
@@ -91,15 +103,21 @@ try {
|
||||
|
||||
isolate = null
|
||||
isolate = new ivm.Isolate({ memoryLimit: 50 }) // 32 seems fine
|
||||
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:
|
||||
source.sendFeedback([cmd, { text: 'Invalid option!', color: 'dark_red' }])
|
||||
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' }])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
this is typescript
|
||||
|
||||
+21
-6
@@ -15,6 +15,9 @@ trustLevel: 1,
|
||||
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,
|
||||
@@ -23,28 +26,40 @@ trustLevel: 1,
|
||||
{ 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) {
|
||||
source.sendFeedback([cmd, { text: e.stack, color: 'black' }])
|
||||
if(!bot.options.Core.enabled){
|
||||
bot.chat(ChatMessage.fromNotch([cmd, { text: e.stack, color: 'black' }]).toMotd().replaceAll('§', '&'))
|
||||
}else{
|
||||
source.sendFeedback([cmd, { text: e.stack, 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,15 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'filter',
|
||||
trustLevel: 1,
|
||||
description:['filter players (not functional)'],
|
||||
execute (context) {
|
||||
//throw new CommandError('temp disabled')
|
||||
const target = context.arguments.join(' ')
|
||||
const bot = context.bot
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
+94
-39
@@ -10,7 +10,9 @@ module.exports = {
|
||||
const commandList = []
|
||||
const source = context.source
|
||||
const args = context.arguments
|
||||
const cmd = {
|
||||
// const amogus = bot.prefix
|
||||
const ChatMessage = require('prismarine-chat')(bot.options.version)
|
||||
const cmd = {
|
||||
translate: '[%s] ',
|
||||
bold: false,
|
||||
color: 'white',
|
||||
@@ -23,9 +25,9 @@ module.exports = {
|
||||
bold: false,
|
||||
color: 'white',
|
||||
with: [
|
||||
{ color: 'green', text: 'Public'},
|
||||
{ color: '#00FFFF', text: 'Public'},
|
||||
{ color: 'white', text: ' | '},
|
||||
{ color: 'red', text: 'Trusted'},
|
||||
{ color: 'dark_purple', text: 'Trusted'},
|
||||
{ color: 'white', text: ' | '},
|
||||
{ color: 'dark_red', text: 'Owner'},
|
||||
]
|
||||
@@ -33,32 +35,54 @@ module.exports = {
|
||||
|
||||
if (args[0]) {
|
||||
let valid
|
||||
for (const fard in bot.commandManager.amogus) { // i broke a key woops
|
||||
const command = bot.commandManager.amogus[fard]
|
||||
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
|
||||
source.sendFeedback([cmd, `Description: ${command.description}`])
|
||||
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
|
||||
}
|
||||
} 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.MainPrefix}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.MainPrefix}help` } : undefined}])
|
||||
|
||||
|
||||
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.amogus.length // ok
|
||||
const length = context.bot.commandManager.commandlist.length // ok
|
||||
//i guess i did delete smh woops
|
||||
|
||||
//context.source.sendFeedback([cmd, 'Commands (', length, ') ', category, ...commandList], false)
|
||||
@@ -67,8 +91,8 @@ module.exports = {
|
||||
let t_rust = []
|
||||
let own_her = []
|
||||
let cons_ole = []
|
||||
for (const fard in bot.commandManager.amogus) {
|
||||
const command = bot.commandManager.amogus[fard]
|
||||
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) {
|
||||
@@ -104,6 +128,11 @@ module.exports = {
|
||||
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 + ' ',
|
||||
@@ -124,21 +153,25 @@ module.exports = {
|
||||
{text:'click on me to use me :)'},
|
||||
]
|
||||
},clickEvent:{
|
||||
action:"run_command",value:`${bot.options.commands.MainPrefix}${command.name}`
|
||||
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}` } : undefined,
|
||||
|
||||
}
|
||||
)//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: 'red',
|
||||
color: 'dark_purple',
|
||||
|
||||
|
||||
translate:"",
|
||||
@@ -154,7 +187,7 @@ module.exports = {
|
||||
{text:'click on me to use me :)'},
|
||||
]
|
||||
},clickEvent:{
|
||||
action:"run_command",value:`${bot.options.commands.MainPrefix}${command.name}`
|
||||
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}
|
||||
|
||||
@@ -163,13 +196,17 @@ module.exports = {
|
||||
|
||||
}
|
||||
)
|
||||
}
|
||||
//my w
|
||||
}
|
||||
else if (command.trustLevel === 0){
|
||||
pub_lick.push(
|
||||
if (!bot.options.Core.enabled && !source.sources.console){
|
||||
pub_lick.push(`&b${command.name + ' '}`)
|
||||
} else{
|
||||
pub_lick.push(
|
||||
{
|
||||
text: command.name + ' ',
|
||||
color: 'green',
|
||||
color: '#00FFFF',
|
||||
translate:"",
|
||||
hoverEvent:{
|
||||
action:"show_text", // Welcome to Kaboom!\n > Free OP - Anarchy - Creative (frfr)
|
||||
@@ -185,40 +222,58 @@ module.exports = {
|
||||
{text:'click on me to use me :)'},
|
||||
]
|
||||
},clickEvent:{
|
||||
action:"suggest_command",value:`${bot.options.commands.MainPrefix}${command.name}`}
|
||||
action:"suggest_command",value:`${bot.options.commands.prefixes[0]}${command.name}`}
|
||||
|
||||
})
|
||||
|
||||
// copypasted from below, and removed stuff that wont work in the console
|
||||
|
||||
}
|
||||
//{command.consoleOnly && !source.sources.console
|
||||
//${command.description}
|
||||
|
||||
// for (const command of context.bot.commandManager.getCommands()) {
|
||||
// if (command.consoleOnly && !context.console) continue
|
||||
}
|
||||
// console.log(pub_lick)
|
||||
// console.log(t_rust)
|
||||
}
|
||||
function sleep(ms) {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}
|
||||
|
||||
// i could do context.source.sources.console
|
||||
// but i want to do it like this
|
||||
// if its buggy change to that
|
||||
// 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(isConsole) {
|
||||
if(source.sources.console) {
|
||||
// mabe idk
|
||||
const length = context.bot.commandManager.amogus.length
|
||||
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
|
||||
|
||||
context.source.sendFeedback([cmd, 'Commands (', length, ') ', category, ...pub_lick, t_rust, own_her, cons_ole], false)
|
||||
} else {
|
||||
const length = context.bot.commandManager.amogus.filter(c => c.trustLevel != 3).length
|
||||
//trustlevel
|
||||
context.source.sendFeedback([cmd, 'Commands (', length, ') ', category, ...pub_lick, t_rust ,own_her], false)
|
||||
|
||||
|
||||
// bot.tellraw([own_her])
|
||||
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)
|
||||
}//
|
||||
}
|
||||
}
|
||||
}
|
||||
+552
-411
@@ -1,434 +1,575 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
const CommandError = require("../CommandModules/command_error");
|
||||
|
||||
const path = require("path");
|
||||
const fs = require("fs");
|
||||
const packageJSON = require("../package.json");
|
||||
|
||||
const path = require('path')
|
||||
const fs = require('fs/promises')
|
||||
const packageJSON = require("../package.json")
|
||||
async function getCpuModelName () {
|
||||
const cpuInfo = await fs.readFile('/proc/cpuinfo')
|
||||
const lines = cpuInfo.toString().split('\n')
|
||||
// among us way of doing it
|
||||
const modelName = lines.find((line) => line.startsWith('model name')).split('\t: ')
|
||||
return modelName[1]
|
||||
}
|
||||
module.exports = {
|
||||
name: 'info',
|
||||
description:['check the bots info. the args are version, discord, serverinfo, logininfo, uptime, memused, creators'],
|
||||
aliases:['information'],
|
||||
trustLevel: 0,
|
||||
async execute (context, client) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
// const client = context.client
|
||||
const cmd = {//test.js
|
||||
translate: '[%s] ',
|
||||
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'},
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
/*context.source.sendFeedback(`${buildstring}`, false)
|
||||
context.source.sendFeedback(`${foundationbuildstring}`)
|
||||
context.source.sendFeedback('BotEngine:Node-Minecraft-Protocol', false)
|
||||
*/
|
||||
|
||||
|
||||
const buildstring = process.env['buildstring']
|
||||
const foundationbuildstring = process.env['FoundationBuildString']
|
||||
const source = context.source
|
||||
switch (args[0]) {
|
||||
case 'version':
|
||||
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"];
|
||||
const npmVersion = packageJSON.dependencies["npm"];
|
||||
|
||||
context.source.sendFeedback ({ color: "gray", text: `${bot.buildstring}`})
|
||||
const MinecraftProtocolVersion =
|
||||
packageJSON.dependencies["minecraft-protocol"];
|
||||
|
||||
context.source.sendFeedback ({ color: "gray", text: `${bot.fbs}`})
|
||||
|
||||
//BotEngine:Node-Minecraft-Protocol @${MinecraftProtocolVersion}
|
||||
|
||||
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`
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
/* 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}`
|
||||
}
|
||||
})
|
||||
*/
|
||||
|
||||
//Discord.js @${discordJSVersion}
|
||||
|
||||
|
||||
|
||||
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}`})
|
||||
|
||||
if(bot.options.Core.CorelessMode){
|
||||
bot.chat(ChatMessage.fromNotch(`${process.env["buildstring"]}`).toMotd().replaceAll('§', '&'))
|
||||
await sleep(1000)
|
||||
|
||||
|
||||
break
|
||||
case 'discord':
|
||||
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')
|
||||
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:`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: `CPU cores: ${os.cpus().length}`})
|
||||
/*const os = require('os') const cpus = os.cpus() for (const cpu of cpus){bot.tellraw(cpu.model)}*/
|
||||
//os.cpus()[0].model
|
||||
/*
|
||||
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.CorelessMode){
|
||||
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.CorelessMode){
|
||||
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 Memory Usage ${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: ${await os.cpus()[0].model}`})
|
||||
// }
|
||||
/*translate: '\n %s \n %s \n %s \n %s \n %s \n %s \n %s',//lazy fix
|
||||
with: [
|
||||
{ color: "gray", text: `Hostname: ${os.hostname()}`},
|
||||
{ color: "gray", text: `Working Directory: ${path.join(__dirname, '..')}`},
|
||||
{ color: "gray", text: `OS architecture: ${os.arch()}`},
|
||||
{ color: "gray", text: `OS platform: ${os.platform()}`},
|
||||
{ color: "gray", text: `OS name: ${os.version()}`},
|
||||
{ color: "gray", text: `CPU cores: ${os.cpus().length}`},
|
||||
{ color: "gray", text: `CPU model: ${await getCpuModelName()}`},
|
||||
|
||||
|
||||
|
||||
]
|
||||
});*/
|
||||
break
|
||||
case 'logininfo':
|
||||
source.sendFeedback({text:`Bot Username: "${bot.username}"`, color:'gray'})
|
||||
source.sendFeedback({text:`Bot uuid:"${bot.uuid}"`, color:'gray'})
|
||||
*/ source.sendFeedback({
|
||||
color: "gray",
|
||||
text: `CPU model: ${os.cpus()[0].model}`,
|
||||
});
|
||||
source.sendFeedback({
|
||||
translate:'%s%s%s',
|
||||
color: "gray",
|
||||
with: [{text:`Server Memory Usage `, 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.CorelessMode){
|
||||
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.CorelessMode){
|
||||
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}`});
|
||||
});
|
||||
|
||||
source.sendFeedback({text:`Minecraft Java Version: "${bot.version}"`, color:'gray'})
|
||||
|
||||
|
||||
source.sendFeedback({text:`Server: "${bot.host}:${bot.port}"`, color:'gray'})
|
||||
|
||||
|
||||
|
||||
source.sendFeedback({text:`Main Prefix: "${bot.options.commands.MainPrefix}"`, color:"gray"})
|
||||
source.sendFeedback({text:`Secondary Prefix: "${bot.options.commands.SecondaryPrefix}"`, color:"gray"})
|
||||
source.sendFeedback({text:`Tertiary Prefix: "${bot.options.commands.TertiaryPrefix}"`, 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){
|
||||
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(host.name)
|
||||
list.push({text:`Server Count: ${host.name}`})
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
source.sendFeedback('Servers in Config: ' + amonger.length)//real
|
||||
/*
|
||||
const util = fs.readdir('./util')
|
||||
source.sendFeedback({text:`Util Files loaded: ${util.length}`, color:'gray'})
|
||||
|
||||
const modules = fs.readdir('./modules')
|
||||
source.sendFeedback({text:`Modules Files loaded: ${modules.length}`, color:'gray'})
|
||||
const commands = fs.readdir('./commands')
|
||||
source.sendFeedback({text:`Commands Files loaded: ${commands.length}`, color:'gray'})
|
||||
const CommandModules = fs.readdir('./CommandModules')
|
||||
source.sendFeedback({text:`CommandModules Files loaded: ${CommandModules.length}`, color:'gray'})
|
||||
const chat = fs.readdir('./chat')
|
||||
source.sendFeedback({text:`Chat Files loaded: ${chat.length}`, color:'gray'})
|
||||
/*
|
||||
const = '../'
|
||||
fs.readdir(, (err, files) => {
|
||||
source.sendFeedback({text:` Files loaded: ${file.length}`, color:'gray'})
|
||||
});
|
||||
*/
|
||||
|
||||
/*context.source.sendFeedback({
|
||||
translate: '\n %s \n %s \n %s \n %s \n %s \n %s \n %s \n %s',
|
||||
with: [
|
||||
{ color: "gray", text: `Bot Username: "${bot.username}"`},
|
||||
{ color: "gray", text: `Bot uuid: "${bot.uuid}"`, clickEvent: {action:"copy_to_clipboard", value: `${context.bot.uuid}`}},
|
||||
{ color: "gray", text: `Minecraft Java Version: "${bot.version}"`},
|
||||
{ color: "gray", text: `Server: "${bot.host}:${bot.port}"`},
|
||||
{ color: "gray", text: `Prefix: "${bot.options.commands.prefix}"`},
|
||||
{ color: "gray", text: `Discord Prefix: "${bot.options.discord.commandPrefix}"`},
|
||||
{ color: "gray", text: `Discord Username: "${bot.discord.client.user.username}#${bot.discord.client.user.discriminator}"`},
|
||||
{ color: "gray", text: `ConsoleServer:"${bot.console.consoleServer}"`}
|
||||
]
|
||||
} */
|
||||
//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(`Mins: ${minutes}`) +
|
||||
" " +
|
||||
pad(`Seconds: ${seconds}`)
|
||||
);
|
||||
}
|
||||
|
||||
var uptime = process.uptime();
|
||||
if(bot.options.Core.CorelessMode){
|
||||
bot.chat(`Bot Uptime: ${format(uptime)}`)
|
||||
} else {
|
||||
|
||||
source.sendFeedback({
|
||||
color: "gray",
|
||||
text: `Bot Uptime: ${format(uptime)}`,
|
||||
});
|
||||
|
||||
*/
|
||||
// clickevent: { action:"open_url", value: `${context.bot.discord.invite}`},
|
||||
|
||||
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')
|
||||
|
||||
|
||||
|
||||
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(`Mins: ${minutes}`) + ' ' + pad(`Seconds: ${seconds}`);
|
||||
}
|
||||
|
||||
var uptime = process.uptime();
|
||||
|
||||
|
||||
source.sendFeedback ({ color: "gray", text: `Bot Uptime: ${format(uptime)}`})
|
||||
|
||||
|
||||
|
||||
|
||||
break
|
||||
case 'memused':
|
||||
const os2 = require('os')
|
||||
source.sendFeedback({ color: "gray", text: `§aMem §aused §a${Math.floor(os2.freemem() / 1048576)} §aMiB §a/ §a${Math.floor(os2.totalmem() / 1048576)} MiB`},)
|
||||
|
||||
/*
|
||||
context.source.sendFeedback({
|
||||
translate: '\n %s',
|
||||
with: [
|
||||
{ color: "gray", text: `§aMem §aused §a${Math.floor(os2.freemem() / 1048576)} §aMiB §a/ §a${Math.floor(os2.totalmem() / 1048576)} MiB`},
|
||||
|
||||
]
|
||||
});
|
||||
*/
|
||||
break
|
||||
|
||||
case 'creators':
|
||||
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'})
|
||||
|
||||
/*
|
||||
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}`
|
||||
}
|
||||
})
|
||||
*/
|
||||
/*
|
||||
context.source.sendFeedback({
|
||||
translate: '\n %s \n %s%s \n %s \n %s \n %s \n %s \n %s \n %s \n %s \n %s \n %s',
|
||||
with: [
|
||||
{ color: 'gray', text: 'Thank you to all that helped!' },
|
||||
{ color: 'dark_red', text: 'Parker' },
|
||||
{ color: 'black', text: '2991' },
|
||||
|
||||
{ color: 'dark_green', text: '_ChipMC_' },
|
||||
|
||||
{ color: 'yellow', text: 'chayapak' },
|
||||
|
||||
{ color: 'light_purple', text: '_yfd' },
|
||||
{ color: 'yellow', text: 'ChomeNS Discord Server: https://discord.gg/xdgCkUyaA4' },
|
||||
{ color: 'aqua', text: 'FNFBoyfriendBot Discord Server: https://discord.gg/GCKtG4erux' },
|
||||
{ color: 'green', text: '(sadly chip doesnt have a discord server) _ChipMC_s Website https://chipmunk.land' },
|
||||
{ color: 'light_purple', text: '_yfds discord server: https://discord.gg/BKYKBxfDrs' },
|
||||
{ color: 'yellow', text: 'chayapaks discord username: chayapak' },
|
||||
{ color: 'green', text: '_ChipMC_s discord username: chipmunkmc' },
|
||||
]
|
||||
});
|
||||
*/
|
||||
break
|
||||
default:
|
||||
context.source.sendError([cmd, { text: 'Invalid action', color: 'dark_red', bold:false }])
|
||||
context.source.sendError([cmd, { text: 'the args for the info command is version, discord, serverinfo, logininfo, uptime, memused, creators', color: 'gray', bold:false }])
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case "creators":
|
||||
if(!bot.options.Core.CorelessMode){
|
||||
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.CorelessMode){
|
||||
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,
|
||||
},
|
||||
]);
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
+3
-3
@@ -13,8 +13,8 @@ module.exports = {
|
||||
// throw new CommandError('temp disabled')
|
||||
//throw new CommandError('command temporarily disabled until hashing is implemented')
|
||||
const args = context.arguments
|
||||
|
||||
if (args[0] === 'clear' || args[0] === 'stop') {
|
||||
if (!args && !args[0] && !args[1]) return
|
||||
if (args[2] === 'clear' || args[2] === 'stop') {
|
||||
clearInterval(this.timer)
|
||||
this.timer = null
|
||||
|
||||
@@ -24,7 +24,7 @@ module.exports = {
|
||||
|
||||
|
||||
// if (this.timer !== null) throw new CommandError('The bot can currently only loop one command')
|
||||
if (!args && !args[0] && !args[1]) return // anti fard
|
||||
// anti fard
|
||||
|
||||
const target = context.player//let me hashonly it rq
|
||||
this.timer = setInterval(function() { // Wait, is this command public?
|
||||
|
||||
+35
-2
@@ -5,7 +5,7 @@ module.exports = {
|
||||
description:['check the player list'],
|
||||
trustLevel: 0,
|
||||
aliases:['playerlist', 'plist', 'pl'],
|
||||
execute (context) {
|
||||
async execute (context) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
const players = bot.players
|
||||
@@ -31,11 +31,44 @@ throw new CommandError({translate:"Too many Arguments!", color:"red"})
|
||||
}
|
||||
|
||||
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{
|
||||
|
||||
source.sendFeedback(component, false)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
//command.unknown.argument command.unknown.command //command.context.here
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
const os = require('os')
|
||||
|
||||
module.exports = {
|
||||
name: 'lol',
|
||||
description:['idfk dont ask'],
|
||||
aliases:['ohio'],
|
||||
trustLevel: 0,
|
||||
execute (context) {
|
||||
throw new CommandError('idfk lmao')
|
||||
|
||||
}
|
||||
}
|
||||
@@ -10,15 +10,16 @@ module.exports = {
|
||||
const bot = context.bot
|
||||
const source = context.source
|
||||
const args = context.arguments
|
||||
switch (args[0]) {
|
||||
if (!args && !args[0] && !args[1] && !args[2] && !args[3] && !args[4] ) return
|
||||
switch (args[0]) {
|
||||
case 'on':
|
||||
bot.memusage.on()
|
||||
|
||||
//source.sendFeedback({text: 'TPSBar is now enabled', color:'green'})
|
||||
source.sendFeedback({text: 'Memusage is now enabled', color:'green'})
|
||||
break
|
||||
case 'off':
|
||||
bot.memusage.off()
|
||||
// source.sendFeedback({text:'TPSBar is now disabled', color:'red'})
|
||||
/ source.sendFeedback({text:'Memusage is now disabled', color:'red'})
|
||||
|
||||
break
|
||||
default:
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'music',
|
||||
//<< this one line of code broke it lmao
|
||||
description:[''],
|
||||
aliases:[],
|
||||
trustLevel: 0,
|
||||
execute (context) {
|
||||
|
||||
const message = context.arguments.join(' ')
|
||||
const bot = context.bot
|
||||
|
||||
throw new CommandError('working on it some other time')
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
//[%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
|
||||
+105
-24
@@ -17,11 +17,44 @@ module.exports = {
|
||||
|
||||
const args = context.arguments
|
||||
const bot = context.bot
|
||||
|
||||
const ChatMessage = require('prismarine-chat')(bot.options.version)
|
||||
const source = context.source
|
||||
const player = context.source.player.displayName
|
||||
//const player = context.source.player.displayName
|
||||
//throw n
|
||||
const component = {
|
||||
|
||||
|
||||
// context.source.player.displayName ?? context.source.player.profile.name,
|
||||
/*
|
||||
function tryParse (json) {
|
||||
try {
|
||||
return JSON.parse(json)
|
||||
} catch (error) {
|
||||
return { text: '' }
|
||||
}
|
||||
}
|
||||
*///obj
|
||||
/*
|
||||
const amogus2 = {text:`${JSON.stringify(context.source.player.displayName ?? context.source.player.profile.name)}`}
|
||||
|
||||
bot.tellraw({text:'amogus ' + JSON.parse(context.source.player.displayName)})
|
||||
*/ //context.source.sendFeedback({text:`Hello, World!, Player: ${player}, uuid: ${uuid}, Argument: ${message}`})
|
||||
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: [
|
||||
{
|
||||
@@ -37,7 +70,7 @@ module.exports = {
|
||||
{
|
||||
text: 'Boyfriend',
|
||||
bold: true,
|
||||
color: 'aqua'
|
||||
color: '#00FFFF'
|
||||
},
|
||||
{
|
||||
text: 'Bot',
|
||||
@@ -69,36 +102,84 @@ module.exports = {
|
||||
},
|
||||
|
||||
|
||||
context.source.player.displayName ?? context.source.player.profile.name,
|
||||
bot.username,
|
||||
|
||||
//entry.displayName
|
||||
{text:message}
|
||||
]//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'
|
||||
|
||||
// context.source.player.displayName ?? context.source.player.profile.name,
|
||||
/*
|
||||
function tryParse (json) {
|
||||
try {
|
||||
return JSON.parse(json)
|
||||
} catch (error) {
|
||||
return { text: '' }
|
||||
}
|
||||
}
|
||||
*///obj
|
||||
/*
|
||||
const amogus2 = {text:`${JSON.stringify(context.source.player.displayName ?? context.source.player.profile.name)}`}
|
||||
},
|
||||
{
|
||||
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.tellraw({text:'amogus ' + JSON.parse(context.source.player.displayName)})
|
||||
*/ //context.source.sendFeedback({text:`Hello, World!, Player: ${player}, uuid: ${uuid}, Argument: ${message}`})
|
||||
if (!message[0]) {
|
||||
context.source.sendFeedback({text:'Message is empty', color:'red'}, false)
|
||||
} else {
|
||||
for (const eachBot of bot.bots) eachBot.tellraw(component)
|
||||
}
|
||||
|
||||
context?.source?.player?.displayName ?? context?.source?.player?.profile?.name,
|
||||
|
||||
//entry.displayName
|
||||
{text:message}
|
||||
]//command.split(' ')[0]
|
||||
}
|
||||
|
||||
|
||||
for (const eachBot of bot.bots)
|
||||
eachBot.tellraw(component)
|
||||
|
||||
//eachBot.chat(`[${bot.options.host}:${bot.options.port}] ${context?.source?.player?.profile?.name} › ${message}`)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
translate:"",
|
||||
hoverEvent:{
|
||||
|
||||
+8
-2
@@ -1,12 +1,18 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'rc',
|
||||
description:['refill the bots core'],
|
||||
trustLevel: 0,
|
||||
aliases:['refillcore'],
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
|
||||
const bot = context.bot
|
||||
|
||||
if (!bot.options.Core.enabled){
|
||||
throw new CommandError('&4Could not fill core because Coreless mode is active!')
|
||||
}else {
|
||||
|
||||
bot.core.refill()
|
||||
context.source.sendFeedback('Successfully Refilled Core!')
|
||||
}
|
||||
}
|
||||
}
|
||||
+46
-34
@@ -1,46 +1,58 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
const buildstring = process.env['buildstring']
|
||||
const foundation = process.env['FoundationBuildString']
|
||||
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) {
|
||||
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 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: 'aqua',
|
||||
text: 'Boyfriend', bold:true
|
||||
translate: "[%s%s%s] \u203a %s",
|
||||
bold: false,
|
||||
color: "white",
|
||||
with: [
|
||||
{
|
||||
color: "dark_purple",
|
||||
text: "FNF",
|
||||
bold: true,
|
||||
},
|
||||
{ color: 'dark_red',
|
||||
text: 'Bot', bold:true
|
||||
{
|
||||
color: "#00FFFF",
|
||||
text: "Boyfriend",
|
||||
bold: true,
|
||||
},
|
||||
{ color: "dark_red", text: "Bot", bold: true },
|
||||
|
||||
{ color: 'green', text: `${message}` }
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
bot.tellraw([prefix])
|
||||
}
|
||||
{ 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
|
||||
// You should remove the with thing and the translate and replace
|
||||
|
||||
// Parker, why is hashing just random characters???
|
||||
//wdym
|
||||
//wdym
|
||||
|
||||
+24
-21
@@ -13,77 +13,80 @@ module.exports = {
|
||||
if (!args && !args[0] && !args[1] && !args[2]) return
|
||||
switch (args[1]) {
|
||||
case 'vanishon':
|
||||
bot.visibility.on()
|
||||
bot.options.selfcare.vanished = true
|
||||
source.sendFeedback({text:'Vanish selfcare on', color:'green'})
|
||||
break
|
||||
case'vanishoff':
|
||||
source.sendFeedback({text:'Vanish selfcare off', color:'red'})
|
||||
bot.visibility.off()
|
||||
bot.options.selfcare.vanished = false
|
||||
bot.command('vanish off')
|
||||
|
||||
break
|
||||
case 'muteon':
|
||||
source.sendFeedback({text:'Mute selfcare on', color:'green'})
|
||||
bot.unmuted.on()
|
||||
bot.options.selfcare.unmuted = true
|
||||
break
|
||||
case 'muteoff':
|
||||
source.sendFeedback({text:'Mute selfcare off', color:'red'})
|
||||
bot.unmuted.off()
|
||||
bot.options.selfcare.unmuted = false
|
||||
break
|
||||
case 'tptoggleon':
|
||||
bot.tptoggle.on()
|
||||
source.sendFeedback({text:'Tptoggle on', color:'green'})
|
||||
bot.options.selfcare.tptoggle = false
|
||||
bot.command('tptoggle on')
|
||||
source.sendFeedback({text:'Tptoggle on', color:'red'})
|
||||
break
|
||||
case 'tptoggleoff':
|
||||
bot.tptoggle.off()
|
||||
source.sendFeedback({text:'Tptoggle off', color: 'red'})
|
||||
bot.options.selfcare.tptoggle = true
|
||||
|
||||
source.sendFeedback({text:'Tptoggle off', color: 'green'})
|
||||
break
|
||||
case 'godon':
|
||||
bot.god.on()
|
||||
bot.options.selfcare.god = true
|
||||
source.sendFeedback({text:'God selfcare on', color: 'green'})
|
||||
break
|
||||
case 'godoff':
|
||||
bot.god.off()
|
||||
bot.options.selfcare.god= false
|
||||
source.sendFeedback({text:'Tptoggle off', color: 'red'})
|
||||
break
|
||||
case 'prefixon':
|
||||
bot.prefix.on()
|
||||
bot.options.selfcare.prefix = true
|
||||
source.sendFeedback({text: 'Prefix selfcare on', color: 'green'})
|
||||
break
|
||||
case 'prefixoff':
|
||||
bot.prefix.off()
|
||||
bot.options.selfcare.prefix = false
|
||||
source.sendFeedback({text:'Prefix selfcare off', color:'red'})
|
||||
break
|
||||
case 'usernameoff':
|
||||
bot.Username.off()
|
||||
bot.options.selfcare.username = false
|
||||
source.sendFeedback({text:'Username selfcare off', color: 'red'})
|
||||
break
|
||||
case 'usernameon':
|
||||
bot.Username.on()
|
||||
bot.options.selfcare.username = true
|
||||
source.sendFeedback({text:'Username selfcare on', color:'green'})
|
||||
break
|
||||
case 'skinon':
|
||||
bot.skin.on()
|
||||
bot.options.selfcare.skin = true
|
||||
source.sendFeedback({text:'Skin selfcare on', color:'green'})
|
||||
break
|
||||
case 'skinoff':
|
||||
bot.skin.off()
|
||||
bot.options.selfcare.skin = false
|
||||
source.sendFeedback({text:'Skin selfcare off', color:'red'})
|
||||
break
|
||||
case 'cspyon':
|
||||
bot.cspy.on()
|
||||
bot.options.selfcare.cspy = true
|
||||
source.sendFeedback({text:'Cspy selfcare on', color:'green'})
|
||||
break
|
||||
case 'cspyoff':
|
||||
bot.cspy.off()
|
||||
bot.options.selfcare.cspy = false
|
||||
source.sendFeedback({text:'Cspy selfcare off', color:'red'})
|
||||
break
|
||||
case 'nicknameon':
|
||||
bot.nickname.on()
|
||||
bot.options.selfcare.nickname= true
|
||||
source.sendFeedback({text:'Nickname selfcare on', color:'green'})
|
||||
break
|
||||
case 'nicknameoff':
|
||||
bot.nickname.off()
|
||||
source.sendFeedback({text:'Nickname selfcare off', color:'red'})
|
||||
bot.options.selfcare.nickname = false
|
||||
source.sendFeedback({text:'Nickname selfcare off', color:'red'})
|
||||
break
|
||||
|
||||
default:
|
||||
|
||||
@@ -26,7 +26,8 @@ trustLevel: 2,
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (this.timer !== null) return
|
||||
this.timer = setInterval(function () {
|
||||
bot.core.run('day')
|
||||
|
||||
+30
-7
@@ -4,7 +4,7 @@ module.exports = {
|
||||
description:['no'],
|
||||
trustLevel: 2,
|
||||
aliases:['svreval'],
|
||||
execute (context, arguments, selector) {
|
||||
async execute (context, arguments, selector) {
|
||||
const bot = context.bot
|
||||
// const args = context.arguments.join(' ')
|
||||
const source = context.source
|
||||
@@ -12,16 +12,39 @@ const source = context.source
|
||||
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(' ');
|
||||
if (!args && !args[0] && !args[1] && !args[2] && !args[3] && !args[4] ) return
|
||||
try {
|
||||
context.source.sendFeedback({ text: util.inspect(eval(script), { stylize }).substring(0, 32700) })
|
||||
} catch (err) {
|
||||
context.source.sendFeedback({ text: err.message, color: 'red' })
|
||||
//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 {
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
const CommandSource = require('../CommandModules/command_source')
|
||||
module.exports = {
|
||||
name: 'test',
|
||||
description:['very 1st command in the bot to test to see if things are working'],
|
||||
trustLevel: 0,
|
||||
aliases:['tst'],
|
||||
execute (context) {
|
||||
|
||||
const bot = context.bot
|
||||
|
||||
const player = context.source.player.profile.name
|
||||
const uuid = context.source.player.uuid
|
||||
const message = context.arguments.join(' ') // WHY SECTION SIGNS!!
|
||||
const component = {
|
||||
translate: '[%s] %s %s %s %s %s',
|
||||
with: [
|
||||
{
|
||||
translate: '%s%s%s',
|
||||
bold:false,
|
||||
with: [
|
||||
{
|
||||
text: 'FNF',
|
||||
bold: true,
|
||||
color: 'dark_purple'
|
||||
|
||||
},
|
||||
{
|
||||
text: 'Boyfriend',
|
||||
bold: true,
|
||||
color: 'aqua'
|
||||
},
|
||||
{
|
||||
text: 'Bot',
|
||||
bold: true,
|
||||
color: 'dark_red'
|
||||
},
|
||||
],
|
||||
clickEvent: bot.options.Core.customName ? { action: 'open_url', value: bot.options.Core.customName } : undefined,
|
||||
hoverEvent: { action: 'show_text', contents: `idfk what to put here` }
|
||||
},
|
||||
{
|
||||
text:'Hello, World!,'
|
||||
},{
|
||||
text:'Player:'
|
||||
},
|
||||
|
||||
|
||||
context.source.player.displayName ?? context.source.player.profile.name,
|
||||
{
|
||||
text:`, uuid: ${uuid}, `
|
||||
},
|
||||
//entry.displayName
|
||||
{text:`Argument: ${message}`}
|
||||
]//command.split(' ')[0]
|
||||
}
|
||||
bot.tellraw(component)
|
||||
// context.source.sendFeedback({text:`Hello, World!, Player: ${player}, uuid: ${uuid}, Argument: ${message}`})
|
||||
|
||||
}
|
||||
}
|
||||
/*
|
||||
|
||||
|
||||
*/
|
||||
//context.source.player.displayName ?? context.source.player.profile.name,
|
||||
@@ -1,22 +0,0 @@
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
|
||||
module.exports = {
|
||||
name: 'testbench',
|
||||
//<< this one line of code broke it lmao
|
||||
description:[''],
|
||||
aliases:['tstbench'],
|
||||
trustLevel: 0,
|
||||
execute (context) {
|
||||
const bot = context.bot
|
||||
const args = context.arguments
|
||||
//bot.core.run(`tag ${context.source.player.profile.name} add bruhify`)
|
||||
bot.bruhifyTextTellraw = args.join(' ')
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
//[%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
|
||||
+17
-2
@@ -5,7 +5,7 @@ module.exports = {
|
||||
description:['check the time'],
|
||||
aliases:['clock', 'timezone'],
|
||||
trustLevel: 0,
|
||||
execute (context) {
|
||||
async execute (context) {
|
||||
const bot = context.bot
|
||||
const message = context.arguments.join(' ')
|
||||
const moment = require('moment-timezone')
|
||||
@@ -13,13 +13,28 @@ const source = context.source
|
||||
const args = context.arguments
|
||||
const timezone = args.join(' ')
|
||||
|
||||
if (!moment.tz.names().map((zone) => zone.toLowerCase()).includes(timezone.toLowerCase())) {
|
||||
if (!moment.tz.names().map((zone) => zone.toLowerCase()).includes(timezone.toLowerCase()) && !bot.options.Core.enabled) {
|
||||
bot.chat('Invalid timezone')
|
||||
}else{
|
||||
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' }]
|
||||
|
||||
|
||||
if (!bot.options.Core.enabled) {
|
||||
function sleep(ms) {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}
|
||||
bot.chat(`The current time and date for the timezone &b${timezone}`)
|
||||
await sleep(1000)
|
||||
bot.chat(`is:`)
|
||||
await sleep(1000)
|
||||
bot.chat(`&a${momented}`)
|
||||
|
||||
}else{
|
||||
source.sendFeedback(component)
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
-2
@@ -1,5 +1,5 @@
|
||||
const between = require('../util/between')
|
||||
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'tpr',
|
||||
description:['teleport to a random place'],
|
||||
@@ -14,8 +14,12 @@ const source = context.source
|
||||
const x = between(-1_000_000, 1_000_000)
|
||||
const y = 100
|
||||
const z = between(-1_000_000, 1_000_000)
|
||||
source.sendFeedback(`Randomly Teleported: ${sender.profile.name} to x:${x} y:${y} z:${z} `)
|
||||
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} `)
|
||||
bot.core.run(`tp ${sender.uuid} ${x} ${y} ${z}`)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
-5
@@ -12,14 +12,21 @@ module.exports = {
|
||||
const args = context.arguments
|
||||
switch (args[0]) {
|
||||
case 'on':
|
||||
bot.tps.on()
|
||||
|
||||
if(!bot.options.Core.enabled){
|
||||
throw new CommandError('Coreless mode is active can not execute command!')
|
||||
}else{
|
||||
bot.tps.on()
|
||||
|
||||
source.sendFeedback({text: 'TPSBar is now enabled', color:'green'})
|
||||
break
|
||||
}
|
||||
break
|
||||
case 'off':
|
||||
bot.tps.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'})
|
||||
|
||||
}
|
||||
break
|
||||
default:
|
||||
throw new CommandError('Invalid argument')
|
||||
|
||||
+12
-3
@@ -13,12 +13,21 @@ const bot = context.bot
|
||||
const args = context.arguments
|
||||
const amonger = args.slice(1).join(' ');
|
||||
const source = context.source
|
||||
try {
|
||||
const ChatMessage = require('prismarine-chat')(bot.options.version)
|
||||
try {
|
||||
const res = await translate(args.slice(2).join(' '), { from: args.slice(1).join(' '), to: args[1] })
|
||||
bot.tellraw([{ text: 'Result: ', color: 'gold' }, { text: res.text, color: 'green' }])
|
||||
} catch (e) {
|
||||
if(!bot.options.Core.enabled){
|
||||
bot.chat(ChatMessage.fromNotch([{ text: 'Result: ', color: 'gold' }, { text: res.text, color: 'green' }]).toMotd().replaceAll('§', '&'))
|
||||
}else{
|
||||
bot.tellraw([{ text: 'Result: ', color: 'gold' }, { text: res.text, color: 'green' }])
|
||||
}
|
||||
} catch (e) {
|
||||
if (!bot.options.Core.enabled){
|
||||
bot.chat(ChatMessage.fromNotch({ text: e.toString(), color: 'red' }).toMotd().replaceAll('§', '&'))
|
||||
}else{
|
||||
source.sendFeedback({ text: e, color: 'red' })
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
+30
-12
@@ -8,6 +8,7 @@ trustLevel: 0,
|
||||
async execute (context) {
|
||||
const source = context.source
|
||||
const args = context.arguments
|
||||
const bot = context.bot
|
||||
const cmd = {
|
||||
translate: '[%s] ',
|
||||
bold: false,
|
||||
@@ -32,21 +33,33 @@ trustLevel: 0,
|
||||
{ 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) {
|
||||
source.sendFeedback([cmd, example, { text: definition.example.replaceAll("\r", ""), color: 'gray' }, { text: ' - ', color: 'white' }])
|
||||
|
||||
|
||||
bot.chat(ChatMessage.fromNotch(await sleep(500)
|
||||
?? [cmd, example, { text: definition.example.replaceAll("\r", ""), color: 'gray' }, { text: ' - ', color: 'white' }]).toMotd().replaceAll('§', '&'))
|
||||
await sleep(500)
|
||||
bot.chat(ChatMessage.fromNotch(await sleep(1000) ?? [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)
|
||||
|
||||
@@ -54,15 +67,20 @@ trustLevel: 0,
|
||||
|
||||
|
||||
//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) {
|
||||
source.sendFeedback([cmd,{ text: e.toString(), color: 'red' }])
|
||||
|
||||
} 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' }])
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+16
-4
@@ -12,13 +12,25 @@ const hash = bot.hash
|
||||
const ownerhash = bot.owner
|
||||
const discordHash = bot.hashing.hash
|
||||
if (args[0] === hash) {
|
||||
source.sendFeedback({ text: 'Valid Hash', color: 'green' })
|
||||
if(!bot.options.Core.enabled){
|
||||
bot.chat('&aValid Hash')
|
||||
}else{
|
||||
source.sendFeedback({ text: 'Valid Hash', color: 'green' })
|
||||
}
|
||||
}else if (args[0] === ownerhash) {
|
||||
source.sendFeedback({text: 'Valid OwnerHash', color:'green'})
|
||||
if(!bot.options.Core.enabled){
|
||||
bot.chat('&aValid Owner Hash')
|
||||
}else{
|
||||
source.sendFeedback({text: 'Valid Owner Hash', color:'green'})
|
||||
}
|
||||
else if (discordHash) {
|
||||
source.sendFeedback({ text: 'Valid 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) {
|
||||
@@ -0,0 +1,29 @@
|
||||
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'})
|
||||
}
|
||||
}
|
||||
}
|
||||
+16
-1
@@ -1,4 +1,5 @@
|
||||
const wiki = require('wikipedia') //
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
module.exports = {
|
||||
name: 'wiki',
|
||||
description:['wikipedia'],
|
||||
@@ -7,7 +8,12 @@ trustLevel: 0,
|
||||
async execute (context) {
|
||||
const source = context.source
|
||||
const args = context.arguments
|
||||
const cmd = {
|
||||
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',
|
||||
@@ -24,9 +30,18 @@ trustLevel: 0,
|
||||
/// 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' }])
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+33
-48
@@ -4,61 +4,46 @@
|
||||
|
||||
bots: [
|
||||
{
|
||||
host: "localhost",
|
||||
host: "serveriphere",
|
||||
username:username(),
|
||||
version:"1.20.1",
|
||||
version:"1.20.2",
|
||||
reconnectDelay: 6000,
|
||||
language:"lolus",
|
||||
console:true,
|
||||
input: true,
|
||||
commands: {
|
||||
MainPrefix: "set Main Prefix here",
|
||||
SecondaryPrefix:'set Secondary prefix here',
|
||||
TertiaryPrefix:'set Tertiary Prefix here'
|
||||
},
|
||||
|
||||
Console:{
|
||||
enabled: false,
|
||||
filelogging:false,
|
||||
},
|
||||
|
||||
|
||||
commands: {
|
||||
prefixes:
|
||||
["!", "!", "!"] // are those the prefixes?
|
||||
},
|
||||
Core: {
|
||||
customName:"core customName here",
|
||||
core: true,
|
||||
customName:"corenamehere",
|
||||
CorelessMode: false,
|
||||
interval:180000
|
||||
},
|
||||
discord: {
|
||||
channelId: "discord channelId here",
|
||||
invite: "discord invite link here",
|
||||
commandPrefix: "discord command prefix here"
|
||||
channelId: "discordchannelidhere",
|
||||
invite: "discordinvitelinkhere",
|
||||
commandPrefix: "!"
|
||||
},
|
||||
skin: {
|
||||
torso:{
|
||||
jacket:true,
|
||||
cape:true,
|
||||
},
|
||||
arms: {
|
||||
leftSleeve:true,
|
||||
rightSleeve:true,
|
||||
},
|
||||
legs:{
|
||||
leftPants:true,
|
||||
rightPants:true,
|
||||
},
|
||||
head:{
|
||||
hat:true
|
||||
},
|
||||
},
|
||||
selfcare: {
|
||||
unmuted: true,
|
||||
vanished: true,
|
||||
prefix: true,
|
||||
skin: true,
|
||||
cspy: true,
|
||||
op: true,
|
||||
gmc: true,
|
||||
username:true,
|
||||
nickname: true,
|
||||
god:true,
|
||||
tptoggle: true,
|
||||
interval:500,
|
||||
}
|
||||
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,
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,53 +1,93 @@
|
||||
const util = require('util')
|
||||
const createBot = require('./bot.js')
|
||||
//const chomensjs = require('./ChomensJS')
|
||||
const util = require("util");
|
||||
const createBot = require("./bot.js");
|
||||
// TODO: Load a default config
|
||||
const fs = require('fs/promises')
|
||||
const fileExist = require('./util/file-exists')
|
||||
const path = require('path')
|
||||
|
||||
function load () {
|
||||
//const config = require('./config.js')
|
||||
const readline = require('readline')
|
||||
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,
|
||||
})
|
||||
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.console.useReadlineInterface(rl)
|
||||
|
||||
// bot.on('error', (error), util.inspect(error))
|
||||
|
||||
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.copyFile(path.join(__dirname, 'default.js'), path.join(__dirname, 'config.js'))
|
||||
} if (await fileExist(path.join(__dirname, 'config.js'))){
|
||||
console.log('Config found! loading config please wait,......')
|
||||
});
|
||||
|
||||
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(
|
||||
"\x1b[0m\x1b[91m[ERROR]: \x1b[0m\x1b[90mFailed to load module",
|
||||
filename,
|
||||
":",
|
||||
error,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
bot.console.useReadlineInterface(rl);
|
||||
|
||||
// bot.on('error', (error), util.inspect(error))
|
||||
|
||||
try {
|
||||
bot.on("error", console.error);
|
||||
} catch (error) {
|
||||
console.log(error.stack);
|
||||
}
|
||||
}
|
||||
|
||||
config = require('./config.js')
|
||||
load()
|
||||
}
|
||||
|
||||
checkConfig()
|
||||
const modules = "./modules";
|
||||
const util2 = "./util";
|
||||
const CommandModules = "./CommandModules";
|
||||
const commands = "./commands";
|
||||
const chat = "./chat";
|
||||
fs.readdir(util2, (err, files) => {
|
||||
console.log("Successfully loaded: " + files.length + " util files");
|
||||
});
|
||||
fs.readdir(modules, (err, files) => {
|
||||
console.log("Successfully loaded: " + files.length + " module files");
|
||||
});
|
||||
fs.readdir(commands, (err, files) => {
|
||||
console.log("Successfully loaded: " + files.length + " command files");
|
||||
});
|
||||
fs.readdir(CommandModules, (err, files) => {
|
||||
console.log("Successfully loaded: " + files.length + " CommandModule files");
|
||||
});
|
||||
fs.readdir(chat, (err, files) => {
|
||||
console.log("Successfully loaded: " + files.length + " chat files");
|
||||
});
|
||||
|
||||
async function checkConfig() {
|
||||
if (!(await fileExist(path.join(__dirname, "config.js")))) {
|
||||
console.error("Config not found! Creating a new Config from ");
|
||||
await fs.copyFile(
|
||||
path.join(__dirname, "default.js"),
|
||||
path.join(__dirname, "config.js"),
|
||||
);
|
||||
}
|
||||
if (await fileExist(path.join(__dirname, "config.js"))) {
|
||||
console.log("Config found! loading config please wait,......");
|
||||
}
|
||||
|
||||
config = require("./config.js");
|
||||
|
||||
load();
|
||||
}
|
||||
|
||||
checkConfig();
|
||||
|
||||
process.on('uncaughtException', (e) => {
|
||||
console.log('uncaught ' + e.stack)
|
||||
})
|
||||
|
||||
|
||||
+10
-4
@@ -1,9 +1,10 @@
|
||||
const convert = require('color-convert')
|
||||
|
||||
function inject (bot) {
|
||||
function bruhify (bot) {
|
||||
bot.bruhifyText = ''
|
||||
let startHue = 0
|
||||
const timer = setInterval(() => {
|
||||
const ChatMessage = require('prismarine-chat')(bot.options.version)
|
||||
const timer = setInterval(() => {
|
||||
if (bot.bruhifyText === '') return
|
||||
let tag = 'bruhify'
|
||||
let hue = startHue
|
||||
@@ -15,13 +16,18 @@ let tag = 'bruhify'
|
||||
component.push({ text: character, color: `#${color}` })
|
||||
hue = (hue + increment) % 360
|
||||
}
|
||||
if (!bot.options.Core.enabled){
|
||||
bot.chat(ChatMessage.fromNotch(component).toMotd().replaceAll('§', '&'))
|
||||
startHue = (startHue + increment) % 360
|
||||
}else{
|
||||
bot.core.run(`minecraft:title @a actionbar ${JSON.stringify(component)}`)
|
||||
|
||||
startHue = (startHue + increment) % 360
|
||||
}, 50)
|
||||
}
|
||||
}, 100)
|
||||
|
||||
bot.on('end', () => {
|
||||
// clearInterval(timer)
|
||||
})
|
||||
}
|
||||
module.exports = inject
|
||||
module.exports = bruhify
|
||||
|
||||
+178
-8
@@ -4,6 +4,7 @@ const chipmunkmodChatParser = require('../chat/chipmunkmod')
|
||||
const chipmunkmodblackilykatverChatParser = require('../chat/chipmunkmodBlackilyKatVer')
|
||||
const typetextChatParser = require('../chat/chatTypeText')
|
||||
const typeemotetextChatParser = require('../chat/chatTypeEmote')
|
||||
const creayunChatParser = require('../chat/creayun')
|
||||
const fs = require('fs')
|
||||
function tryParse (json) {
|
||||
try {
|
||||
@@ -13,13 +14,13 @@ function tryParse (json) {
|
||||
}
|
||||
}
|
||||
//what was changed??
|
||||
function inject (bot) {
|
||||
function chat (bot, context) {
|
||||
let ChatMessage
|
||||
bot.on('registry_ready', registry => {
|
||||
ChatMessage = loadPrismarineChat(registry)
|
||||
})
|
||||
|
||||
bot.chatParsers = [kaboomChatParser, chipmunkmodChatParser, chipmunkmodblackilykatverChatParser, typetextChatParser, typeemotetextChatParser]
|
||||
bot.chatParsers = [kaboomChatParser, chipmunkmodChatParser, chipmunkmodblackilykatverChatParser, typetextChatParser, typeemotetextChatParser, creayunChatParser]
|
||||
|
||||
bot.on('packet.profileless_chat', packet => {
|
||||
const message = tryParse(packet.message)
|
||||
@@ -116,8 +117,172 @@ function inject (bot) {
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (plainMessage.startsWith('amogus')) {
|
||||
bot.chat('amongus is very sus &4&lඞ')
|
||||
} return
|
||||
})
|
||||
bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (plainMessage.startsWith('fard')) {
|
||||
bot.chat('fart')
|
||||
} return
|
||||
})
|
||||
bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (plainMessage.startsWith('stroke')) {
|
||||
bot.chat('&4&l&kfaslkjdfhlaskdjfhlaskjfhlakjdfhluiqwhefloewhfkjhasdlfkjhaldkfjhaslfdjhlhadfhlafdshlksajdfhkajsdfhkhjfaslkjdfhlaskdjfhlaskjfhlakjdfhluiqwhefloewhfkjhasdlfkjhaldkfjhaslfdjhlhadfhlafdshlksajdfhkajsdfhkhj')
|
||||
} return
|
||||
})/*
|
||||
bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (plainMessage.startsWith('true')) {
|
||||
bot.chat(' false')
|
||||
} return
|
||||
})
|
||||
|
||||
bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (plainMessage.startsWith('false')) {
|
||||
bot.chat(' true')
|
||||
} return
|
||||
})
|
||||
bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (plainMessage.startsWith('beep')) {
|
||||
bot.chat('bee do ba')
|
||||
} return
|
||||
})
|
||||
bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (plainMessage.startsWith('maniaplay')) {
|
||||
bot.chat('&4[&c&lOP&4] &cmaniaplay: i hate command cores i hope everyone who uses them dies in their sleep 😊')
|
||||
} return
|
||||
})
|
||||
bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (plainMessage.startsWith('null')) {
|
||||
bot.chat('n u l l')
|
||||
|
||||
} return
|
||||
})
|
||||
bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (plainMessage.startsWith('undefined')) {
|
||||
bot.chat('my brain is undefined')
|
||||
|
||||
} return
|
||||
})
|
||||
bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (plainMessage.startsWith('nya')) {
|
||||
bot.chat(' nya~')
|
||||
|
||||
} return
|
||||
})
|
||||
bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (plainMessage.startsWith('mrrow')) {
|
||||
bot.chat(' mrrow')
|
||||
|
||||
} return
|
||||
})
|
||||
bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (plainMessage.startsWith('uwu')) {
|
||||
bot.chat(' OwO')
|
||||
|
||||
} return
|
||||
})
|
||||
bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (plainMessage.startsWith('owo')) {
|
||||
bot.chat(' UwU')
|
||||
|
||||
} return
|
||||
})
|
||||
|
||||
|
||||
bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (plainMessage.startsWith('what time is it')) {
|
||||
bot.chat('time for you to get a watch')
|
||||
} return
|
||||
})
|
||||
|
||||
bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (plainMessage.startsWith('69')) {
|
||||
bot.chat('funni number')
|
||||
} return
|
||||
})
|
||||
/* bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (plainMessage.startsWith('real')) {
|
||||
bot.chat('very')
|
||||
} return
|
||||
})*/
|
||||
|
||||
/* bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (plainMessage.startsWith('meow')) {
|
||||
bot.chat(' :3')
|
||||
} return
|
||||
})
|
||||
bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (plainMessage.startsWith('qwerty')) {
|
||||
bot.chat(' qwerty')
|
||||
} return
|
||||
})*/
|
||||
/*
|
||||
bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (plainMessage.startsWith('')) {
|
||||
bot.chat('')
|
||||
} return
|
||||
})
|
||||
*/
|
||||
bot.command = command => {
|
||||
bot._client.write('chat_command', {
|
||||
command,
|
||||
@@ -130,8 +295,13 @@ function inject (bot) {
|
||||
previousMessages: []
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
bot.tellraw = (message, selector = '@a') => bot.core.run('minecraft:tellraw @a ' + JSON.stringify(message)) // ? Should this be here?
|
||||
}
|
||||
|
||||
module.exports = inject
|
||||
}/* const timer = setInterval(() => {
|
||||
bot.chat(`Join the FNFBoyfriendBot discord ${bot.options.discord.invite}`)
|
||||
}, 200000)
|
||||
const timer1 = setInterval(() => {
|
||||
bot.chat('')
|
||||
}, 300000)
|
||||
*/
|
||||
module.exports = chat
|
||||
|
||||
+103
-51
@@ -1,57 +1,109 @@
|
||||
const CommandSource = require('../CommandModules/command_source')
|
||||
const CommandError = require('../CommandModules/command_error')
|
||||
const CommandSource = require("../CommandModules/command_source");
|
||||
const CommandError = require("../CommandModules/command_error");
|
||||
//can i change the var?
|
||||
function chat_command_handler(bot) {
|
||||
let ratelimit = 0
|
||||
bot.on("parsed_message", (data) => {
|
||||
if (data.type !== "minecraft:chat") return;
|
||||
|
||||
function inject (bot) {
|
||||
bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
const prefixes = bot.options.commands.prefixes;
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (!plainMessage.startsWith(bot.commandManager.MainPrefix) && (!plainMessage.startsWith(bot.commandManager.SecondaryPrefix) && (!plainMessage.startsWith(bot.commandManager.TertiaryPrefix)))) return
|
||||
// else if (!plainMessage.startsWith(bot.commandManager.prefix2)) return
|
||||
// MainPrefix: "~",
|
||||
// SecondaryPrefix:'%',
|
||||
//TertiaryPrefix:'@'
|
||||
|
||||
const command = plainMessage.substring(bot.commandManager.MainPrefix.length || plainMessage.substring(bot.commandManager.SecondaryPrefix.length || plainMessage.substring(bot.commandManager.TertiaryPrefix.length))) // if the prefixes are the same length just make it 1 or the length
|
||||
/*
|
||||
lifes sus
|
||||
*/
|
||||
const source = new CommandSource(data.sender, { discord: false, console: false }, true)
|
||||
source.sendFeedback = message => {
|
||||
const prefix = {
|
||||
translate: '[%s%s%s] \u203a ',
|
||||
bold: false,
|
||||
color: 'dark_gray',
|
||||
with: [
|
||||
{
|
||||
color: 'dark_purple',
|
||||
text: 'FNF',
|
||||
bold:true,
|
||||
hoverEvent: { action:"show_text", value: `${process.env["buildstring"]}\n${process.env["FoundationBuildString"]}`},
|
||||
clickEvent: bot.options.Core.customName ? { action: 'open_url', value: bot.options.Core.customName } : undefined,
|
||||
},
|
||||
{
|
||||
color: 'aqua',
|
||||
text: 'Boyfriend', bold:true,
|
||||
clickEvent: bot.options.discord.invite ? { action: 'open_url', value: bot.options.discord.invite } : undefined, hoverEvent: { action:"show_text", value: `Bot Username: ${bot.username}\nBot UUID: ${bot.uuid}\nServer Host: ${bot.options.host}:${bot.options.port}\nBot Minecraft Java Version: ${bot.options.version}`},
|
||||
},
|
||||
{ color: 'dark_red',
|
||||
text: 'Bot',
|
||||
bold:true,
|
||||
clickEvent: bot.options.discord.invite ? { action: 'open_url', value: 'https://code.chipmunk.land' } : undefined,
|
||||
hoverEvent: { action:"show_text", value: '§aMan i like frogs - _ChipMC_'},
|
||||
},//§aMan i like frogs - _ChipMC_
|
||||
prefixes.map((prefix) => {
|
||||
const plainMessage = bot
|
||||
.getMessageAsPrismarine(data.contents)
|
||||
?.toString();
|
||||
if (!plainMessage.startsWith(prefix)) return;
|
||||
// else if (!plainMessage.startsWith(bot.commandManager.prefix2)) return
|
||||
// MainPrefix: "~",
|
||||
// SecondaryPrefix:'%',
|
||||
//TertiaryPrefix:'@'
|
||||
|
||||
{ color: 'green', text: command.split(' ')[0] }
|
||||
]
|
||||
}
|
||||
const command = plainMessage.substring(prefix.length); // if the prefixes are the same length just make it 1 or the length
|
||||
/*
|
||||
lifes sus
|
||||
*/
|
||||
const source = new CommandSource(
|
||||
data.sender,
|
||||
{ discord: false, console: false }, //
|
||||
|
||||
);
|
||||
source.sendFeedback = (message) => {
|
||||
const prefix = {
|
||||
translate: "[%s%s%s] \u203a ",
|
||||
bold: false,
|
||||
color: "dark_gray",
|
||||
with: [
|
||||
{
|
||||
color: "dark_purple",
|
||||
text: "FNF",
|
||||
bold: true,
|
||||
hoverEvent: {
|
||||
action: "show_text",
|
||||
value: `${process.env["buildstring"]}\n${process.env["FoundationBuildString"]}`,
|
||||
},
|
||||
clickEvent: bot.options.Core.customName
|
||||
? { action: "open_url", value: bot.options.Core.customName }
|
||||
: undefined,
|
||||
},
|
||||
{
|
||||
color: "#00FFFF",
|
||||
text: "Boyfriend",
|
||||
bold: true,
|
||||
clickEvent: bot.options.discord.invite
|
||||
? { action: "open_url", value: bot.options.discord.invite }
|
||||
: undefined,
|
||||
hoverEvent: {
|
||||
action: "show_text",
|
||||
value: `Bot Username: ${bot.username}\nBot UUID: ${bot.uuid}\nServer Host: ${bot.options.host}:${bot.options.port}\nBot Minecraft Java Version: ${bot.options.version}`,
|
||||
},
|
||||
},
|
||||
{
|
||||
color: "dark_red",
|
||||
text: "Bot",
|
||||
bold: true,
|
||||
clickEvent: bot.options.discord.invite
|
||||
? { action: "open_url", value: "https://code.chipmunk.land" }
|
||||
: undefined,
|
||||
hoverEvent: {
|
||||
action: "show_text",
|
||||
value: "§aMan i like frogs - _ChipMC_",
|
||||
},
|
||||
}, //§aMan i like frogs - _ChipMC_
|
||||
|
||||
{ color: "green", text: command.split(" ")[0] },
|
||||
],
|
||||
};
|
||||
|
||||
bot.tellraw(["", prefix, message]);
|
||||
};
|
||||
try{
|
||||
|
||||
bot.tellraw(['', prefix, message])
|
||||
}
|
||||
|
||||
bot.commandManager.executeString(source, command)
|
||||
|
||||
})
|
||||
ratelimit++
|
||||
setTimeout(() => {
|
||||
ratelimit--
|
||||
}, 1000)
|
||||
if (ratelimit > 3) { // ,.
|
||||
if(!bot.options.Core.enabled){
|
||||
bot.chat('&4You are using commands to fast!')
|
||||
}else {
|
||||
source.sendFeedback({text:'You are using commands to fast!',color:'dark_red'})
|
||||
// this isn't blocking running the command you know that right?
|
||||
}
|
||||
} else {
|
||||
bot.commandManager.executeString(source, command);
|
||||
}//oh real
|
||||
|
||||
module.exports = inject
|
||||
//can i change the variable name so its name isnt confusing?
|
||||
}catch(e){
|
||||
console.log(e.stack)
|
||||
|
||||
|
||||
|
||||
//then where to move this?
|
||||
|
||||
|
||||
};
|
||||
});
|
||||
})//
|
||||
}
|
||||
module.exports = chat_command_handler;
|
||||
|
||||
+15
-4
@@ -1,5 +1,5 @@
|
||||
const nbt = require('prismarine-nbt');
|
||||
async function inject (bot, options) {
|
||||
async function command_core (bot, options) {
|
||||
bot.core = {
|
||||
// what you think im doing? look at line 17
|
||||
area: {
|
||||
@@ -15,7 +15,7 @@ async function inject (bot, options) {
|
||||
|
||||
if (!pos) return
|
||||
|
||||
bot.command(`fill ${pos.x + start.x} ${pos.y + start.y} ${pos.z + start.z} ${pos.x + end.x} ${pos.y + end.y} ${pos.z + end.z} repeating_command_block{CustomName: '{"text":"${bot.options.Core.customName}","color":"dark_red","clickEvent":{"action":"open_url","value":"${bot.options.Core.customName}"}}'} destroy`)
|
||||
bot.command(`fill ${pos.x + start.x} ${pos.y + start.y} ${pos.z + start.z} ${pos.x + end.x} ${pos.y + end.y} ${pos.z + end.z} repeating_command_block{CustomName: '{"text":"${bot.options.Core.customName}","color":"#00FFFF","clickEvent":{"action":"open_url","value":"https://chipmunk.land"}}'} destroy`)
|
||||
|
||||
},
|
||||
|
||||
@@ -71,7 +71,17 @@ async function inject (bot, options) {
|
||||
},
|
||||
|
||||
}
|
||||
if (!bot.options.Core.core) return
|
||||
/*
|
||||
bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (plainMessage.startsWith(':3')) {
|
||||
bot.chat(' :3')
|
||||
} return
|
||||
})
|
||||
*/
|
||||
if (!bot.options.Core.enabled) return
|
||||
bot.on('move', () => {
|
||||
bot.core.move(bot.position)
|
||||
//setTimeout(() => bot.core.run('say hi'), 100)
|
||||
@@ -82,7 +92,8 @@ async function inject (bot, options) {
|
||||
}, bot.options.Core.interval)
|
||||
bot.on('end', (bot) => {
|
||||
clearInterval(timer)
|
||||
|
||||
})
|
||||
})
|
||||
}
|
||||
module.exports = inject
|
||||
module.exports = command_core
|
||||
|
||||
@@ -1,11 +1,19 @@
|
||||
function inject (bot, options) {
|
||||
function command_loop_manager (bot, options) {
|
||||
bot.cloop = {
|
||||
list: [],
|
||||
|
||||
add (command, interval) {
|
||||
this.list.push({ timer: setInterval(() => bot.core.run(command), interval), 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)
|
||||
},
|
||||
@@ -16,6 +24,7 @@ function inject (bot, options) {
|
||||
this.list = []
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = inject
|
||||
module.exports = command_loop_manager
|
||||
|
||||
+200
-198
@@ -1,214 +1,216 @@
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const CommandError = require('../CommandModules/command_error.js')
|
||||
const fs = require("fs");
|
||||
const path = require("path");
|
||||
const CommandError = require("../CommandModules/command_error.js");
|
||||
//check command_source
|
||||
//it would be both the command_source.js and command_manager.js files
|
||||
function inject (bot, options) {
|
||||
async function command_manager(bot, options) {
|
||||
bot.commandManager = {
|
||||
MainPrefix: options.commands?.MainPrefix ?? 'default',
|
||||
SecondaryPrefix: options.commands?.SecondaryPrefix ?? 'default',
|
||||
TertiaryPrefix: options.commands?.TertiaryPrefix ?? 'default',
|
||||
commands: {},
|
||||
amogus: [],
|
||||
//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"})
|
||||
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 (!command || !command.execute) throw new CommandError({ translate: `Unknown command %s. Type "${bot.options.commands.MainPrefix}help" for help or click on this for the command`, with: [commandName], clickEvent: bot.options.Core.customName ? { action: 'suggest_command', value: `${bot.options.commands.MainPrefix}help` } : undefined})//ohio
|
||||
|
||||
|
||||
|
||||
if (command.trustLevel > 0){
|
||||
const event = source?.discordMessageEvent
|
||||
|
||||
const roles = event?.member?.roles?.cache
|
||||
|
||||
// message.member.displayName
|
||||
//const hash = `${args[0]}` // this is undefined
|
||||
//const owner = `${args[0]}`
|
||||
// const hash = `${args[0]}`
|
||||
// const owner = `${args[0]}`
|
||||
if(
|
||||
source?.sources?.discord &&
|
||||
command.trustLevel === 1 &&
|
||||
!roles?.some(role => role?.name == 'trusted' || role?.name == 'FNFBoyfriendBot Owner') ? true : false
|
||||
) throw new CommandError({text:'You are not Trusted!', color:'red'})
|
||||
if (
|
||||
!source?.sources?.discord &&
|
||||
command.trustLevel === 1 &&
|
||||
args[0] !== bot.hash &&
|
||||
args[0] !== bot.owner &&
|
||||
args[0] !== bot.hashing.hash
|
||||
) 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 &&
|
||||
command.trustLevel === 2 && owner !== bot.owner
|
||||
)throw new CommandError({text: 'Invalid Owner Hash', color:'dark_red'})
|
||||
|
||||
if (command.trustLevel === 3 && !source?.sources?.console) throw new CommandError({ translate: 'This command can only be executed via console', color: 'blue' })
|
||||
//if ()
|
||||
}// if (command.consoleOnly && !source.sources.console) throw new CommandError({ translate: 'This command can only be executed via console', color: 'blue' })
|
||||
//(hash !== bot.hash && owner !== bot.owner
|
||||
//command.unknown.argument command.unknown.command
|
||||
//command.context.here
|
||||
// let hash = 1
|
||||
// let owner = 2
|
||||
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'
|
||||
|
||||
//command.hashOnly && command.ownerOnly && args.length !== 0 && source.hash && source.owner
|
||||
// if (command.hashOnly && args.length === 0) throw new CommandError({ translate: 'Please provide a hash or a OwnerHash', color: 'red' })
|
||||
|
||||
//<\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}\x1b[0m]`
|
||||
// actual hash
|
||||
//but look in hashing.js
|
||||
//im looking through chomensjs's command handler for reference
|
||||
//💀
|
||||
// <\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]
|
||||
|
||||
//command.hashOnly && source.sources.discord
|
||||
//supposed to be a command error for invalid hash
|
||||
// if (command.hashOnly && args.length === 0) throw new CommandError({ translate: 'Please provide a hash or a OwnerHash', color: 'red' })
|
||||
|
||||
// {text:'Invalid Trusted hash or invalid Owner Hash', color:'red'}
|
||||
// you cant do a empty if
|
||||
// but i didnt know it can be just undefined :skull:
|
||||
//sus
|
||||
//commented smh out about and ig that worked
|
||||
// sus
|
||||
// if("e") {} // ok
|
||||
// idfk how to explain but it does
|
||||
// real (there was no if)
|
||||
|
||||
|
||||
// isnt it if(something) {} or i
|
||||
//if(
|
||||
|
||||
// )//tf
|
||||
|
||||
/*
|
||||
if (command.trustLevel > 0) {
|
||||
const discordRoles = message.member?.roles?.cache
|
||||
|
||||
|
||||
|
||||
if(
|
||||
sources.source.discord &&
|
||||
command.trustLevel === 1 &&
|
||||
!discordRoles.some((role) => role.name === 'trusted' ||
|
||||
role.name === 'FNFBoyfriendBot Owner')
|
||||
)throw new CommandError({text:'You are not trusted!', color:'red'})
|
||||
let hash
|
||||
let owner
|
||||
if (
|
||||
!sources.source.discord &&
|
||||
command.trustLevel === 1 &&
|
||||
args.shift() !== hash &&
|
||||
args.shift() !== owner
|
||||
)
|
||||
*/
|
||||
// just shift it out of the args (mabe would help with needing to do cloop e add 1 say hi)
|
||||
|
||||
//idfk
|
||||
//tf
|
||||
// why the fard did it include the comment in the eror it sent
|
||||
//so replace args[0] with arg.shift()
|
||||
// just do args.shift()
|
||||
// or mabe const hasharg = args.shift()
|
||||
// idk
|
||||
//aaa
|
||||
//expression expected
|
||||
//ik that but why tf is it erroring
|
||||
? {//fr
|
||||
// theme moment
|
||||
action: "suggest_command",
|
||||
value: `${bot.options.commands.prefixes[0]}help`,
|
||||
}
|
||||
: undefined,
|
||||
}); //ohio
|
||||
}
|
||||
|
||||
// wat the fard
|
||||
// sus
|
||||
|
||||
return command.execute({ bot, source, arguments: args })
|
||||
if (command?.trustLevel > 0) {
|
||||
const event = source?.discordMessageEvent;
|
||||
|
||||
const roles = event?.member?.roles?.cache;
|
||||
|
||||
if (
|
||||
source?.sources?.discord &&
|
||||
command.trustLevel === 1 &&
|
||||
!roles?.some(
|
||||
(role) =>
|
||||
role?.name == "trusted" ||
|
||||
role?.name == "FNFBoyfriendBot Owner",
|
||||
)
|
||||
? true
|
||||
: false
|
||||
)
|
||||
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)//const filename of fs.readdirSync(path.join(__dirname, '../commands'
|
||||
//console.error('Failed to load command', filename, ':', error)
|
||||
//${path.join(__dirname, '..')}
|
||||
//const filename of fs.readdirSync(path.join(__dirname, '../commands'
|
||||
//filenames.forEach(function(filename) {
|
||||
//fs.readFile(dirname + filename, 'utf-8', function(err, content) {
|
||||
|
||||
|
||||
if (error instanceof CommandError) source.sendError(error._message)
|
||||
//
|
||||
// else source.sendError({ text:String(error.stack), color:'red' })
|
||||
else source.sendError({ translate: 'A 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)
|
||||
}
|
||||
}
|
||||
},
|
||||
// else source.sendError({ translate: 'command.failed', hoverEvent: { action: 'show_text', contents: String(error.message) } })
|
||||
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)
|
||||
}
|
||||
}
|
||||
//
|
||||
amogus = []
|
||||
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;
|
||||
|
||||
for (const filename of fs.readdirSync(path.join(__dirname, '../commands'))) {
|
||||
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.amogus.push(command)
|
||||
|
||||
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)
|
||||
console.error("Failed to load command", filename, ":", error);
|
||||
}
|
||||
|
||||
if (process.env['anti-skid'] !== 'amogus is sus') {
|
||||
process.exit(0)
|
||||
if (process.env["anti-skid"] !== "amogus is sus") {
|
||||
process.exit(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
module.exports = inject
|
||||
module.exports = command_manager;
|
||||
|
||||
+200
-163
@@ -1,114 +1,96 @@
|
||||
const CommandSource = require('../CommandModules/command_source')
|
||||
//const logger = require('../util/logger')
|
||||
|
||||
function inject (bot, options, context, source) {
|
||||
|
||||
bot.console = {
|
||||
const CommandSource = require("../CommandModules/command_source");
|
||||
// idk if it's modules or utils though
|
||||
//modules is automatically loaded
|
||||
function Console(bot, options, context, source) {
|
||||
let ratelimit = 0
|
||||
bot.console = {
|
||||
readline: null,
|
||||
username:bot.username,
|
||||
consoleServer: 'all',
|
||||
//bot._client.username,
|
||||
useReadlineInterface (rl) {
|
||||
this.readline = rl
|
||||
|
||||
|
||||
|
||||
rl.on('line', line => {
|
||||
if (bot.options.host !== this.consoleServer && this.consoleServer !== 'all') return
|
||||
|
||||
|
||||
if (line.startsWith('.')) {
|
||||
return bot.commandManager.executeString(
|
||||
bot.console.source,
|
||||
|
||||
line.substring(1),
|
||||
//null
|
||||
`${process.env["FNFBoyfriendBot_Owner_key"]}`
|
||||
|
||||
)
|
||||
}
|
||||
|
||||
if (line === ',kill') process.exit()
|
||||
if (line === ',reconnect') bot._client.end()
|
||||
|
||||
|
||||
|
||||
|
||||
//probably gotta somehow have it get its username
|
||||
//tried that already didnt work just errored
|
||||
//profile or smh :shrug:
|
||||
username: bot.username,
|
||||
consoleServer: "all",
|
||||
//bot._client.username,
|
||||
useReadlineInterface(rl) {
|
||||
this.readline = rl;
|
||||
|
||||
rl.on("line", (line) => {
|
||||
if (
|
||||
bot.options.host !== this.consoleServer &&
|
||||
this.consoleServer !== "all"
|
||||
)
|
||||
return;
|
||||
|
||||
if (line.startsWith(".")) {
|
||||
return bot.commandManager.executeString(
|
||||
bot.console.source,
|
||||
|
||||
line.substring(1),
|
||||
//null
|
||||
`${process.env["FNFBoyfriendBot_Owner_key"]}`,
|
||||
);
|
||||
}
|
||||
|
||||
if (line === ",kill") process.exit();
|
||||
if (line === ",reconnect") bot._client.end();
|
||||
|
||||
//probably gotta somehow have it get its username
|
||||
//tried that already didnt work just errored
|
||||
//profile or smh :shrug:
|
||||
// what does it have to be
|
||||
|
||||
if (line.startsWith('')){
|
||||
return bot.commandManager.executeString(
|
||||
bot.console.source,
|
||||
'console ' + line.substring(0)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (line.startsWith("")) {
|
||||
if(bot.options.Core.CorelessMode){
|
||||
|
||||
return bot.commandManager.executeString(
|
||||
bot.console.source,
|
||||
"echo " + line.substring(0),
|
||||
)
|
||||
}else {
|
||||
return bot.commandManager.executeString(
|
||||
bot.console.source,
|
||||
"console " + line.substring(0),
|
||||
);
|
||||
}
|
||||
}
|
||||
//bot.commandManager.executeString(bot.console.source, line)
|
||||
});
|
||||
|
||||
const now = new Date().toLocaleString("en-US", {
|
||||
timeZone: "America/CHICAGO",
|
||||
});
|
||||
const time = new Date().toLocaleTimeString("en-US", {
|
||||
timeZone: "America/CHICAGO",
|
||||
});
|
||||
const date = new Date().toLocaleDateString("en-US", {
|
||||
timeZone: "America/CHICAGO",
|
||||
});
|
||||
|
||||
// const source = context.source
|
||||
|
||||
const prefix = `<\x1b[0m\x1b[35m${time} \x1b[0m\x1b[96m${date}\x1b[0m> [${bot.options.host}:${bot.options.port}\x1b[0m] `;
|
||||
|
||||
function log(...args) {
|
||||
rl.output.write("\x1b[2K\r");
|
||||
console.log(args.toString());
|
||||
rl._refreshLine();
|
||||
}
|
||||
|
||||
bot.console.warn = function (error) {
|
||||
log(prefix + `[\x1b[0m\x1b[93mWARN\x1b[0m]: ${error}`);
|
||||
};
|
||||
bot.console.error = function (error) {
|
||||
log(prefix + `[\x1b[0m\x1b[31mERROR\x1b[0m]: ${error}`);
|
||||
};
|
||||
|
||||
bot.console.info = function (message) {
|
||||
log(prefix + `[\x1b[0m\x1b[32mInfo\x1b[0m]: ` + message);
|
||||
};
|
||||
bot.console.log = function (message, ansi) {
|
||||
log(prefix + `[\x1b[0m\x1b[33mLOGS\x1b[0m]: ` + message);
|
||||
};
|
||||
bot.console.debug = function (message, ansi) {
|
||||
log(prefix + `[\x1b[0m\x1b[33mDEBUG\x1b[0m]: ` + message);
|
||||
};
|
||||
|
||||
|
||||
|
||||
//bot.commandManager.executeString(bot.console.source, line)
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
function prefix (prefix, _message) {
|
||||
const now = new Date().toLocaleString("en-US",{timeZone:"America/CHICAGO"})
|
||||
const message = `[${now} \x1b[0m\x1b[33mLOGS\x1b[0m] [${bot.options.host}:${bot.options.port}]`
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
//date.toLocaleDateString() for the date part, and date.toLocaleTimeString()
|
||||
const now = new Date().toLocaleString("en-US",{timeZone:"America/CHICAGO"})
|
||||
const time = new Date().toLocaleTimeString("en-US", {timeZone:"America/CHICAGO"})
|
||||
const date = new Date().toLocaleDateString("en-US", {timeZone:"America/CHICAGO"})
|
||||
|
||||
// const source = context.source
|
||||
|
||||
|
||||
const prefix = `<\x1b[0m\x1b[35m${time} \x1b[0m\x1b[96m${date}\x1b[0m> [${bot.options.host}:${bot.options.port}\x1b[0m] `
|
||||
|
||||
function log (...args) {
|
||||
rl.output.write('\x1b[2K\r')
|
||||
console.log(args.toString())
|
||||
rl._refreshLine()
|
||||
};
|
||||
|
||||
bot.console.warn = function (error) {
|
||||
log(prefix + `[\x1b[0m\x1b[93mWARN\x1b[0m]: ${error}`)
|
||||
}
|
||||
bot.console.error = function (error) {
|
||||
log(prefix + `[\x1b[0m\x1b[31mERROR\x1b[0m]: ${error}`)
|
||||
}
|
||||
|
||||
bot.console.info = function (message) {
|
||||
log(prefix + `[\x1b[0m\x1b[32mInfo\x1b[0m]:` + message)
|
||||
}
|
||||
bot.console.log = function (message, ansi) {
|
||||
|
||||
log(prefix + `[\x1b[0m\x1b[33mLOGS\x1b[0m]: ` + message)
|
||||
}
|
||||
bot.console.debug = function (message, ansi) {
|
||||
|
||||
log(prefix + `[\x1b[0m\x1b[33mDEBUG\x1b[0m]: ` + message)
|
||||
}
|
||||
/*
|
||||
const player = source.player.profile.name
|
||||
const uuid = source.player.uuid
|
||||
|
||||
console.log(`[${now} \x1b[0m\x1b[91mHash\x1b[0m] [\x1b[0m\x1b[92mSender: ${player}, uuid:${uuid}, hash:${bot.hash}\x1b[0m]`)
|
||||
*/
|
||||
/* const ansimap = {
|
||||
/* const ansimap = {
|
||||
0: '\x1b[0m\x1b[30m',
|
||||
1: '\x1b[0m\x1b[34m',
|
||||
2: '\x1b[0m\x1b[32m',
|
||||
@@ -131,63 +113,118 @@ const date = new Date().toLocaleDateString("en-US", {timeZone:"America/CHICAGO"}
|
||||
n: '\x1b[4m',
|
||||
m: '\x1b[9m',
|
||||
k: '\x1b[6m'
|
||||
}*/ /*return bot.commandManager.executeString(
|
||||
bot.username,
|
||||
options.commands.prefix + line.substring(1),
|
||||
bot.uuid,
|
||||
null,
|
||||
|
||||
)*/
|
||||
}*/
|
||||
const isConsole = bot.username ? true : false;
|
||||
bot.console.source = new CommandSource(bot.username, {
|
||||
console: true,
|
||||
discord: false,
|
||||
});
|
||||
bot.console.source.sendFeedback = (message) => {
|
||||
|
||||
const ansi = bot.getMessageAsPrismarine(message)?.toAnsi();
|
||||
|
||||
// bot.username
|
||||
//const amogus = username,
|
||||
|
||||
//name: message?.member?.displayName
|
||||
const isConsole = bot.username ? true : false
|
||||
bot.console.source = new CommandSource( bot.username,{console:true, discord:false });
|
||||
bot.console.source.sendFeedback = message => {
|
||||
//profile:{displayName:bot.username}
|
||||
const ansi = bot.getMessageAsPrismarine(message)?.toAnsi()
|
||||
|
||||
if (!bot.options.input) return
|
||||
if (!bot.options.console) return
|
||||
bot.console.log(ansi)
|
||||
|
||||
}
|
||||
if (!bot.options.Console.input) return;
|
||||
if (!bot.options.Console.enabled) return;
|
||||
bot.console.info(ansi);
|
||||
};
|
||||
|
||||
bot.on('message', message => {
|
||||
function log (...args) {
|
||||
rl.output.write('\x1b[2K\r')
|
||||
console.log(args.toString())
|
||||
rl._refreshLine()
|
||||
};
|
||||
const time = new Date().toLocaleTimeString("en-US", {timeZone:"America/CHICAGO"})
|
||||
const date = new Date().toLocaleDateString("en-US", {timeZone:"America/CHICAGO"})
|
||||
const prefixy = `<\x1b[0m\x1b[35m${time} \x1b[0m\x1b[96m${date}\x1b[0m> [${bot.options.host}:${bot.options.port}\x1b[0m] `
|
||||
|
||||
bot.console.logs = function (message, ansi) {
|
||||
|
||||
log(prefixy + `[\x1b[0m\x1b[33mLOGS\x1b[0m]: ` + message)
|
||||
}
|
||||
const lang = require(`../util/language/${bot.options.language}.json`)
|
||||
const ansi = bot.getMessageAsPrismarine(message)?.toAnsi(lang)
|
||||
const string = bot.getMessageAsPrismarine(message)?.toString()
|
||||
|
||||
const now = new Date().toLocaleString("en-US",{timeZone:"America/CHICAGO"})
|
||||
// const logtag = (JSON.stringify({"text":"[LOGS]", "color":"#00FF00"}))
|
||||
const time2 = new Date().toLocaleTimeString("en-US", {timeZone:"America/CHICAGO"})
|
||||
const date2 = new Date().toLocaleDateString("en-US", {timeZone:"America/CHICAGO"})
|
||||
bot.on("parsed_message", (data) => {
|
||||
if (data.type !== "minecraft:chat") return;
|
||||
|
||||
const plainMessage = bot
|
||||
.getMessageAsPrismarine(data.contents)
|
||||
?.toString();
|
||||
if (plainMessage.startsWith("frog")) {
|
||||
bot.chat("frok :)");
|
||||
}
|
||||
return;
|
||||
});
|
||||
|
||||
bot.on("message", (message) => {
|
||||
function log(...args) {
|
||||
rl.output.write("\x1b[2K\r");
|
||||
console.log(args.toString());
|
||||
rl._refreshLine();
|
||||
}
|
||||
const time = new Date().toLocaleTimeString("en-US", {
|
||||
timeZone: "America/CHICAGO",
|
||||
});
|
||||
const date = new Date().toLocaleDateString("en-US", {
|
||||
timeZone: "America/CHICAGO",
|
||||
});
|
||||
const prefixy = `<\x1b[0m\x1b[35m${time} \x1b[0m\x1b[96m${date}\x1b[0m> [${bot.options.host}:${bot.options.port}\x1b[0m] `;
|
||||
|
||||
bot.console.logs = function (message, ansi) {
|
||||
log(prefixy + `[\x1b[0m\x1b[33mLOGS\x1b[0m]: ` + message);
|
||||
};
|
||||
const lang = require(`../util/language/lolus.json`);
|
||||
const ansi = bot.getMessageAsPrismarine(message)?.toAnsi(lang);
|
||||
const string = bot.getMessageAsPrismarine(message)?.toString(lang);
|
||||
|
||||
const now = new Date().toLocaleString("en-US", {
|
||||
timeZone: "America/CHICAGO",
|
||||
});
|
||||
const time2 = new Date().toLocaleTimeString("en-US", {
|
||||
timeZone: "America/CHICAGO",
|
||||
});
|
||||
const date2 = new Date().toLocaleDateString("en-US", {
|
||||
timeZone: "America/CHICAGO",
|
||||
});
|
||||
|
||||
|
||||
// if (!bot.options.Console.input) return;
|
||||
if (!bot.options.Console.enabled) return;
|
||||
|
||||
//const prefix = `<${time2} ${date2}> [${bot.options.host}:${bot.options.port}] `
|
||||
if (!bot.options.input) return
|
||||
if (!bot.options.console) return
|
||||
bot.console.logs(`${ansi}`)
|
||||
ratelimit++
|
||||
setTimeout(() => {
|
||||
ratelimit--
|
||||
}, 1000)
|
||||
if (ratelimit > 35) { // ,.
|
||||
|
||||
})
|
||||
bot.console.logs = function () {}
|
||||
} else {
|
||||
//bot.console.log(`${ansi}`);
|
||||
//oh real
|
||||
|
||||
//can i change the variable name so its name isnt confusing?
|
||||
|
||||
bot.console.logs(`${ansi}`);
|
||||
|
||||
// logger(`<${time} ${date}> [${bot.options.host}:${bot.options.port}] [LOGS]: ${string}`)
|
||||
if (bot.console && bot.console.filelogger) {
|
||||
bot.console.filelogger(`<${time} ${date}> [${bot.options.host}:${bot.options.port}] [LOGS]: ${string}`)
|
||||
|
||||
}//nothing is logging to the file
|
||||
/*
|
||||
try{
|
||||
|
||||
ratelimit++
|
||||
setTimeout(() => {
|
||||
ratelimit--
|
||||
}, 1000)
|
||||
if (ratelimit > 5) { // ,.
|
||||
|
||||
source.sendFeedback({text:'You are using commands to fast!',color:'dark_red'})
|
||||
// this isn't blocking running the command you know that right?
|
||||
} else {
|
||||
bot.commandManager.executeString(source, command);
|
||||
}//oh real
|
||||
|
||||
//can i change the variable name so its name isnt confusing?
|
||||
}catch(e){
|
||||
console.log(e.stack)
|
||||
|
||||
|
||||
|
||||
//then where to move this?
|
||||
|
||||
|
||||
};
|
||||
*/
|
||||
};
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}//const prefix = `<\x1b[0m\x1b[35m${time} \x1b[0m\x1b[96m${date}\x1b[0m> [${bot.options.host}:${bot.options.port}\x1b[0m] `
|
||||
}
|
||||
module.exports = inject
|
||||
/*const message = `[${moment().format('DD/MM/YY HH:mm:ss')} ${prefix}§r] [${bot.server.host}] `
|
||||
const component = chatMessage.MessageBuilder.fromString(message).toJSON()
|
||||
*/
|
||||
|
||||
module.exports = Console;
|
||||
|
||||
+16
-7
@@ -9,12 +9,12 @@ const client = new Client({ intents: [Guilds, GuildMessages, MessageContent] })
|
||||
const util = require('util')
|
||||
client.login(process.env.discordtoken)
|
||||
|
||||
function inject (bot, options) {
|
||||
function discord (bot, options) {
|
||||
if (!options.discord?.channelId) {
|
||||
bot.discord = { invite: options.discord?.invite }
|
||||
return
|
||||
}
|
||||
|
||||
const ChatMessage = require('prismarine-chat')(bot.options.version)
|
||||
bot.discord = {
|
||||
client,
|
||||
channel: undefined,
|
||||
@@ -74,7 +74,7 @@ function inject (bot, options) {
|
||||
*/
|
||||
//`\`\`\`\n \n\`\`\`
|
||||
function sendComponent (message) {
|
||||
const lang = require(`../util/language/${bot.options.language}.json`)
|
||||
const lang = require(`../util/language/lolus.json`)
|
||||
const ansi = bot.getMessageAsPrismarine(message).toAnsi(lang).replaceAll('```\u001b[9```' + '```\u001b[3```')// I have a function to fix ansi :shrug:
|
||||
|
||||
/*
|
||||
@@ -126,13 +126,15 @@ function inject (bot, options) {
|
||||
|
||||
source.sendFeedback = message => {
|
||||
sendComponent(message)
|
||||
console.log(message.content)
|
||||
//console.log(message.content)
|
||||
}
|
||||
|
||||
bot.commandManager.executeString(source, message.content.substring(bot.discord.commandPrefix.length))
|
||||
return
|
||||
}
|
||||
|
||||
if(!bot.options.Core.enabled){
|
||||
bot.chat(`&8[&5FNF&bBoyfriend&4Bot &9Discord&8] ${message.member.displayName.replaceAll('\xa7', '&')}&f › ${message.content.replaceAll('\xa7', '&')}`)
|
||||
}else{
|
||||
bot.tellraw({
|
||||
translate: '[%s] %s \u203a %s',
|
||||
with: [
|
||||
@@ -171,7 +173,7 @@ function inject (bot, options) {
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
client.on('messageCreate', messageCreate)
|
||||
|
||||
bot.on('kick_disconnect', reason => {
|
||||
@@ -188,6 +190,9 @@ function inject (bot, options) {
|
||||
//sendDiscordMessage(reason)
|
||||
|
||||
})
|
||||
bot.on('packet.login', (data) => {
|
||||
sendDiscordMessage(`Connecting to ${bot.options.host}:${bot.options.port}`)
|
||||
})
|
||||
bot.on('end', reason => {
|
||||
|
||||
sendDiscordMessage(JSON.stringify(reason))
|
||||
@@ -202,6 +207,10 @@ function inject (bot, options) {
|
||||
//sendDiscordMessage(reason)
|
||||
|
||||
})
|
||||
process.on("uncaughtException", (e) => {
|
||||
sendDiscordMessage("uncaught " + e.stack);
|
||||
});
|
||||
|
||||
/*bot.on('end', (reason, event) => {
|
||||
sendDiscordMessage('event:' + event)
|
||||
sendDiscordMessage('Reason:' + util.inspect(reason))
|
||||
@@ -244,4 +253,4 @@ function fixansi(message) {
|
||||
}
|
||||
}
|
||||
//
|
||||
module.exports = inject
|
||||
module.exports = discord
|
||||
|
||||
+10
-3
@@ -3,7 +3,7 @@
|
||||
const crypto = require('crypto')
|
||||
const ownerkey = process.env['FNFBoyfriendBot_Owner_key']
|
||||
const trustedkey = process.env['FNFBoyfriendBot_key']
|
||||
function inject(bot) {
|
||||
function hashgen (bot) {
|
||||
bot.hash = ''
|
||||
bot.owner = ''
|
||||
bot.updatehashes = update
|
||||
@@ -35,7 +35,14 @@ function inject(bot) {
|
||||
})
|
||||
*/
|
||||
}
|
||||
|
||||
bot.on('parsed_message', data => {
|
||||
if (data.type !== 'minecraft:chat') return
|
||||
|
||||
const plainMessage = bot.getMessageAsPrismarine(data.contents)?.toString()
|
||||
if (plainMessage.startsWith('fnf sky')) {
|
||||
bot.chat('sky the fangirl!?!? i simp for her :)')
|
||||
} return
|
||||
})
|
||||
let _hash = generateHash()
|
||||
const now = new Date().toLocaleString("en-US",{timeZone:"America/CHICAGO"})
|
||||
const time = new Date().toLocaleTimeString("en-US", {timeZone:"America/CHICAGO"})
|
||||
@@ -71,7 +78,7 @@ const date = new Date().toLocaleDateString("en-US", {timeZone:"America/CHICAGO"}
|
||||
function generateHash () {
|
||||
return crypto.randomBytes(4).toString('hex')
|
||||
}
|
||||
module.exports = inject
|
||||
module.exports = hashgen
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
function consolefilelogger (bot, options, message) {
|
||||
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 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
|
||||
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
|
||||
}//oh wait
|
||||
} catch (e) {} // prevent it from throwing a ohio exception mabe mabe
|
||||
|
||||
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
|
||||
|
||||
// if (toFile) logStream.write(toWrite + '\n');
|
||||
|
||||
bot.console.filelogger = function (message) {//.
|
||||
logStream.write(message + '\n'); // toFile is not defined
|
||||
};
|
||||
//if (toConsole) console.log(toWrite);
|
||||
};//tf
|
||||
|
||||
module.exports = consolefilelogger
|
||||
+47
-30
@@ -1,35 +1,52 @@
|
||||
function memusage (bot, options){
|
||||
const clamp = require('../util/clamp')
|
||||
const title = 'Memusage'
|
||||
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
|
||||
const os = require("os");
|
||||
let enabled = false;
|
||||
let tag = "FNFBoyfriendBotMemusage";
|
||||
bot.memusage = {
|
||||
on() {
|
||||
enabled = true;
|
||||
},
|
||||
off () {
|
||||
enabled = false
|
||||
bot.core.run(`minecraft:title @a actionbar ${title}`)
|
||||
}
|
||||
}
|
||||
const tickRates = []
|
||||
let nextIndex = 0
|
||||
let timeLastTimeUpdate = -1
|
||||
let timeGameJoined
|
||||
off() {
|
||||
enabled = false;
|
||||
bot.core.run(`minecraft:bossbar remove ${bossbarName}`);
|
||||
},
|
||||
};//
|
||||
|
||||
|
||||
const interval = setInterval(() => {
|
||||
if (!enabled) return
|
||||
if (!enabled) return;
|
||||
|
||||
const component = {
|
||||
|
||||
text: `Mem used ${Math.floor(process.memoryUsage().heapUsed / 1000 / 1000)} MiB / ${Math.floor(process.memoryUsage().heapTotal / 1000 / 1000)} MiB. CPU Usage ${JSON.stringify(process.cpuUsage())} `,
|
||||
color: 'dark_gray'
|
||||
|
||||
}//process.cpuUsage
|
||||
bot.core.run(`minecraft:title @a[tag=${tag}] actionbar ${JSON.stringify(component)}`)
|
||||
}, 50)//process.memoryUsage().heapUsed /1024 / 1024
|
||||
|
||||
}
|
||||
module.exports = memusage
|
||||
/* 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;
|
||||
|
||||
+3
-3
@@ -23,7 +23,7 @@ const soundNames = {
|
||||
pling: 'minecraft:block.note_block.pling'
|
||||
}
|
||||
|
||||
function inject (bot) {
|
||||
function music (bot) {
|
||||
bot.music = function () {}
|
||||
bot.music.song = null
|
||||
bot.music.loop = 0
|
||||
@@ -140,7 +140,7 @@ function inject (bot) {
|
||||
noteIndex = 0
|
||||
bot.core.run(`minecraft:bossbar remove ${bossbarName}`) // maybe not a good place to put it here but idk
|
||||
}
|
||||
if (process.env["buildstring"] !== "§5FridayNightFunkin§bBoyfriend§4Bot §8v5.0.3 §8Build:325")
|
||||
if (process.env["buildstring"] !== "§5FridayNightFunkin§bBoyfriend§4Bot §8v5.0.5 §8Build:360 Codename:§#f001dbQT §#740000KB §0Termination")
|
||||
{
|
||||
process.exit(1)
|
||||
}
|
||||
@@ -177,4 +177,4 @@ if (process.env["buildstring"] !== "§5FridayNightFunkin§bBoyfriend§4Bot §8v5
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = inject
|
||||
module.exports = music
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
function inject (bot) {
|
||||
function player_list (bot) {
|
||||
bot.players = []
|
||||
//chayapak you mentally ok?
|
||||
bot.on('packet.player_info', packet => {
|
||||
@@ -46,7 +46,7 @@ function inject (bot) {
|
||||
target.removePlayer = entry.removePlayer
|
||||
}
|
||||
}//
|
||||
if (process.env['FoundationBuildString'] !== 'Ultimate Foundation v2.0.3 Build:225')
|
||||
if (process.env['FoundationBuildString'] !== 'Ultimate Foundation v2.0.5 Build:260')
|
||||
{
|
||||
process.exit(1)
|
||||
}
|
||||
@@ -103,7 +103,7 @@ removePlayer:undefined,
|
||||
bot.on('end', () => (bot.players = []))
|
||||
}
|
||||
|
||||
module.exports = inject
|
||||
module.exports = player_list
|
||||
/*function addPlayer (player, packet) {
|
||||
if (bot.players.getPlayer(player)) bot.emit('player_unvanished', player, packet)
|
||||
else bot.emit('player_added', player, packet)
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
function inject (bot) {
|
||||
function position (bot) {
|
||||
bot.position = null
|
||||
|
||||
bot.on('packet.position', packet => {
|
||||
@@ -16,4 +16,4 @@ function inject (bot) {
|
||||
bot.on('end', () => { bot.position = null })
|
||||
}
|
||||
|
||||
module.exports = inject
|
||||
module.exports = position
|
||||
|
||||
+4
-4
@@ -1,11 +1,11 @@
|
||||
const createRegistry = require('prismarine-registry')
|
||||
|
||||
function inject (bot) {
|
||||
function registry (bot) {
|
||||
bot.on('packet.login', packet => {
|
||||
bot.registry = createRegistry(bot._client.version)
|
||||
bot.registry.loadDimensionCodec(packet.dimensionCodec)
|
||||
// bot.registry.loadDimensionCodec(packet.dimensionCodec)
|
||||
bot.emit('registry_ready', bot.registry)
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = inject
|
||||
//1.20.2 support wooooooo
|
||||
module.exports = registry
|
||||
|
||||
+8
-7
@@ -4,7 +4,7 @@ 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 inject (bot) {
|
||||
function selfcare (bot) {
|
||||
let entityId
|
||||
let gameMode
|
||||
let permissionLevel = 2
|
||||
@@ -28,13 +28,13 @@ let unmuted = false
|
||||
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.MainPrefix}&8]`) {
|
||||
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 Parker2991's") {
|
||||
else if (stringmessage === `Successfully set your skin to ${bot.options.selfcare.skin.player}'s`) {
|
||||
skin = true
|
||||
return
|
||||
}
|
||||
@@ -108,15 +108,16 @@ let unmuted = false
|
||||
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 (!vanished && bot.options.selfcare.vanished) bot.core.run(`essentials:vanish ${bot.username} enable`)
|
||||
|
||||
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.MainPrefix}&8]`)
|
||||
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) bot.command('skin Parker2991')
|
||||
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`)
|
||||
}, bot.options.selfcare.interval)
|
||||
})
|
||||
|
||||
@@ -134,7 +135,7 @@ let unmuted = false
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = inject
|
||||
module.exports = selfcare
|
||||
/*const buildstring = process.env['buildstring']
|
||||
bot.on('login', async () => {
|
||||
console.log(`starting ${buildstring}`)
|
||||
|
||||
+9
-9
@@ -1,6 +1,6 @@
|
||||
const assert = require('assert')
|
||||
|
||||
module.exports = inject
|
||||
module.exports = ClientSettings
|
||||
|
||||
const chatToBits = {
|
||||
enabled: 0,
|
||||
@@ -28,7 +28,7 @@ const controls = {
|
||||
sprint: false,
|
||||
sneak: false
|
||||
}
|
||||
function inject (bot, options) {
|
||||
function ClientSettings (bot, options) {
|
||||
function setSettings (settings) {
|
||||
extend(bot.settings, settings)
|
||||
|
||||
@@ -84,13 +84,13 @@ function inject (bot, options) {
|
||||
: options.difficulty,
|
||||
skinParts: options.skinParts == null
|
||||
? {
|
||||
showCape: bot.options.skin.torso.cape,
|
||||
showJacket: bot.options.skin.torso.jacket,
|
||||
showLeftSleeve: bot.options.skin.arms.leftSleeve,
|
||||
showRightSleeve: bot.options.skin.arms.rightSleeve,
|
||||
showLeftPants: bot.options.skin.legs.leftPants,
|
||||
showRightPants: bot.options.skin.legs.rightPants,
|
||||
showHat: bot.options.skin.head.hat
|
||||
showCape: true,
|
||||
showJacket: true,
|
||||
showLeftSleeve: true,
|
||||
showRightSleeve: true,
|
||||
showLeftPants: true,
|
||||
showRightPants: true,
|
||||
showHat: true
|
||||
}
|
||||
: options.skinParts,
|
||||
mainHand: options.mainHand || 'left',
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
function team (bot, context, data) {
|
||||
const CommandSource = require('../CommandModules/command_source')
|
||||
|
||||
}
|
||||
module.exports = team
|
||||
@@ -1,76 +0,0 @@
|
||||
const clamp = require('../util/clamp')
|
||||
function inject (bot, config) {
|
||||
const bossbarName = 'tps'
|
||||
|
||||
let enabled = false
|
||||
bot.tps = {
|
||||
on () {
|
||||
enabled = true
|
||||
},
|
||||
off () {
|
||||
enabled = false
|
||||
bot.core.run(`minecraft:bossbar remove ${bossbarName}`)
|
||||
}
|
||||
}
|
||||
|
||||
const tickRates = []
|
||||
let nextIndex = 0
|
||||
let timeLastTimeUpdate = -1
|
||||
let timeGameJoined
|
||||
|
||||
const interval = setInterval(() => {
|
||||
if (!enabled) return
|
||||
|
||||
const component = {
|
||||
translate: `https://doin-your.mom TPS - %s`,
|
||||
color: 'gray',
|
||||
bold: false,
|
||||
with: [
|
||||
{ text: getTickRate(), color: 'green' }
|
||||
]
|
||||
}
|
||||
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`)
|
||||
bot.core.run(`minecraft:bossbar set ${bossbarName} value ${Math.floor(getTickRate())}`)
|
||||
// bot.tellraw(Math.floor(getTickRate()))
|
||||
}, 50)
|
||||
|
||||
function getTickRate () {
|
||||
if (Date.now() - timeGameJoined < 4000) return 'Calculating...'
|
||||
|
||||
let numTicks = 0
|
||||
let sumTickRates = 0.0
|
||||
for (const tickRate of tickRates) {
|
||||
if (tickRate > 0) {
|
||||
sumTickRates += tickRate
|
||||
numTicks++
|
||||
}
|
||||
}
|
||||
|
||||
const value = (sumTickRates / numTicks).toFixed(2)
|
||||
if (value > 20) return 20
|
||||
else return value
|
||||
}
|
||||
|
||||
bot.on('login', () => {
|
||||
nextIndex = 0
|
||||
timeGameJoined = timeLastTimeUpdate = Date.now()
|
||||
})
|
||||
|
||||
bot._client.on('update_time', () => {
|
||||
const now = Date.now()
|
||||
const timeElapsed = (now - timeLastTimeUpdate) / 1000.0
|
||||
tickRates[nextIndex] = clamp(20.0 / timeElapsed, 0.0, 20.0)
|
||||
nextIndex = (nextIndex + 1) % tickRates.length
|
||||
timeLastTimeUpdate = now
|
||||
})
|
||||
|
||||
bot.on('end', () => clearInterval(interval))
|
||||
}
|
||||
|
||||
module.exports = inject
|
||||
@@ -0,0 +1,78 @@
|
||||
const clamp = require("../util/clamp");
|
||||
function tpsbar(bot, config) {
|
||||
const bossbarName = "tps";
|
||||
|
||||
let enabled = false;
|
||||
bot.tps = {
|
||||
on() {
|
||||
enabled = true;
|
||||
},
|
||||
off() {
|
||||
enabled = false;
|
||||
bot.core.run(`minecraft:bossbar remove ${bossbarName}`);
|
||||
},
|
||||
};
|
||||
|
||||
const tickRates = [];
|
||||
let nextIndex = 0;
|
||||
let timeLastTimeUpdate = -1;
|
||||
let timeGameJoined;
|
||||
|
||||
const interval = setInterval(() => {
|
||||
if (!enabled) return;
|
||||
|
||||
const component = {
|
||||
translate: `https://doin-your.mom TPS - %s`,
|
||||
color: "gray",
|
||||
bold: false,
|
||||
with: [{ text: getTickRate(), color: "green" }],
|
||||
};
|
||||
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`);
|
||||
bot.core.run(
|
||||
`minecraft:bossbar set ${bossbarName} value ${Math.floor(getTickRate())}`,
|
||||
);
|
||||
// bot.tellraw(Math.floor(getTickRate()))
|
||||
}, 100);
|
||||
|
||||
function getTickRate() {
|
||||
if (Date.now() - timeGameJoined < 4000) return "Calculating...";
|
||||
|
||||
let numTicks = 0;
|
||||
let sumTickRates = 0.0;
|
||||
for (const tickRate of tickRates) {
|
||||
if (tickRate > 0) {
|
||||
sumTickRates += tickRate;
|
||||
numTicks++;
|
||||
}
|
||||
}
|
||||
|
||||
const value = (sumTickRates / numTicks).toFixed(2);
|
||||
if (value > 20) return 20;
|
||||
else return value;
|
||||
}
|
||||
|
||||
bot.on("login", () => {
|
||||
nextIndex = 0;
|
||||
timeGameJoined = timeLastTimeUpdate = Date.now();
|
||||
});
|
||||
|
||||
bot._client.on("update_time", () => {
|
||||
const now = Date.now();
|
||||
const timeElapsed = (now - timeLastTimeUpdate) / 1000.0;
|
||||
tickRates[nextIndex] = clamp(20.0 / timeElapsed, 0.0, 20.0);
|
||||
nextIndex = (nextIndex + 1) % tickRates.length;
|
||||
timeLastTimeUpdate = now;
|
||||
});
|
||||
|
||||
bot.on("end", () => clearInterval(interval));
|
||||
}
|
||||
|
||||
module.exports = tpsbar;
|
||||
Generated
+129
-179
@@ -15,12 +15,13 @@
|
||||
"dockerode": "^4.0.0",
|
||||
"dotenv": "^16.3.1",
|
||||
"isolated-vm": "^4.6.0",
|
||||
"minecraft-data": "^3.53.0",
|
||||
"minecraft-data": "^3.59.3",
|
||||
"minecraft-protocol": "^1.45.0",
|
||||
"minecraft-protocol-forge": "^1.0.0",
|
||||
"mineflayer": "^4.14.0",
|
||||
"mineflayer-cmd": "^1.1.3",
|
||||
"moment-timezone": "^0.5.43",
|
||||
"node-fetch": "^2.7.0",
|
||||
"npm": "^9.5.1",
|
||||
"prismarine-chat": "^1.9.1",
|
||||
"prismarine-nbt": "^2.2.1",
|
||||
@@ -29,7 +30,7 @@
|
||||
"randomstring": "^1.3.0",
|
||||
"readline": "^1.3.0",
|
||||
"sharp": "^0.32.6",
|
||||
"urban-dictionary": "^3.0.2",
|
||||
"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",
|
||||
@@ -38,24 +39,24 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@azure/msal-common": {
|
||||
"version": "14.5.0",
|
||||
"resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-14.5.0.tgz",
|
||||
"integrity": "sha512-Gx5rZbiZV/HiZ2nEKfjfAF/qDdZ4/QWxMvMo2jhIFVz528dVKtaZyFAOtsX2Ak8+TQvRsGCaEfuwJFuXB6tu1A==",
|
||||
"version": "14.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-14.6.0.tgz",
|
||||
"integrity": "sha512-AGusT/JvxdzJIYi5u0n97cmhd3pUT6UuI6rEkT5iDeT2FGcV0/EB8pk+dy6GLPpYg9vhDCuyoYrEZGd+2UeCCQ==",
|
||||
"engines": {
|
||||
"node": ">=0.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@azure/msal-node": {
|
||||
"version": "2.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-2.6.0.tgz",
|
||||
"integrity": "sha512-RWAWCYYrSldIYC47oWtofIun41e6SB9TBYgGYsezq6ednagwo9ZRFyRsvl1NabmdTkdDDXRAABIdveeN2Gtd8w==",
|
||||
"version": "2.6.1",
|
||||
"resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-2.6.1.tgz",
|
||||
"integrity": "sha512-wYwz83pWatTNWUCkTi3cAOXbchad5FnZz/pbZz7b8Z6FuEqohXcTtg6BLip9SmcjN6FlbwUdJIZYOof2v1Gnrg==",
|
||||
"dependencies": {
|
||||
"@azure/msal-common": "14.5.0",
|
||||
"@azure/msal-common": "14.6.0",
|
||||
"jsonwebtoken": "^9.0.0",
|
||||
"uuid": "^8.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "16|| 18 || 20"
|
||||
"node": ">=16"
|
||||
}
|
||||
},
|
||||
"node_modules/@balena/dockerignore": {
|
||||
@@ -179,16 +180,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@sapphire/shapeshift": {
|
||||
"version": "3.9.4",
|
||||
"resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-3.9.4.tgz",
|
||||
"integrity": "sha512-SiOoCBmm8O7QuadLJnX4V0tAkhC54NIOZJtmvw+5zwnHaiulGkjY02wxCuK8Gf4V540ILmGz+UulC0U8mrOZjg==",
|
||||
"version": "3.9.5",
|
||||
"resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-3.9.5.tgz",
|
||||
"integrity": "sha512-AGdHe+51gF7D3W8hBfuSFLBocURDCXVQczScTHXDS3RpNjNgrktIx/amlz5y8nHhm8SAdFt/X8EF8ZSfjJ0tnA==",
|
||||
"dependencies": {
|
||||
"fast-deep-equal": "^3.1.3",
|
||||
"lodash": "^4.17.21"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=v14.0.0",
|
||||
"npm": ">=7.0.0"
|
||||
"node": ">=v18"
|
||||
}
|
||||
},
|
||||
"node_modules/@sapphire/snowflake": {
|
||||
@@ -215,17 +215,17 @@
|
||||
"integrity": "sha512-EqX+YQxINb+MeXaIqYDASb6U6FCHbWjkj4a1CKDBks3d/QiB2+PqBLyO72vLDgAO1wUI4O+9gweRcQK11bTL/w=="
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "20.10.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.3.tgz",
|
||||
"integrity": "sha512-XJavIpZqiXID5Yxnxv3RUDKTN5b81ddNC3ecsA0SoFXz/QU8OGBwZGMomiq0zw+uuqbL/krztv/DINAQ/EV4gg==",
|
||||
"version": "20.10.8",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.8.tgz",
|
||||
"integrity": "sha512-f8nQs3cLxbAFc00vEU59yf9UyGUftkPaLGfvbVOIDdx2i1b8epBqj2aNGyP19fiyXWvlmZ7qC1XLjAzw/OKIeA==",
|
||||
"dependencies": {
|
||||
"undici-types": "~5.26.4"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/readable-stream": {
|
||||
"version": "4.0.9",
|
||||
"resolved": "https://registry.npmjs.org/@types/readable-stream/-/readable-stream-4.0.9.tgz",
|
||||
"integrity": "sha512-4cwuvrmNF96M4Nrx0Eep37RwPB1Mth+nCSezsGRv5+PsFyRvDdLd0pil6gVLcWD/bh69INNdwZ98dJwfHpLohA==",
|
||||
"version": "4.0.10",
|
||||
"resolved": "https://registry.npmjs.org/@types/readable-stream/-/readable-stream-4.0.10.tgz",
|
||||
"integrity": "sha512-AbUKBjcC8SHmImNi4yK2bbjogQlkFSg7shZCcicxPQapniOlajG8GCc39lvXzCWX4lLRRs7DM3VAeSlqmEVZUA==",
|
||||
"dependencies": {
|
||||
"@types/node": "*",
|
||||
"safe-buffer": "~5.1.1"
|
||||
@@ -295,9 +295,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/acorn": {
|
||||
"version": "8.11.2",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.2.tgz",
|
||||
"integrity": "sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==",
|
||||
"version": "8.11.3",
|
||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz",
|
||||
"integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==",
|
||||
"bin": {
|
||||
"acorn": "bin/acorn"
|
||||
},
|
||||
@@ -357,11 +357,11 @@
|
||||
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
|
||||
},
|
||||
"node_modules/axios": {
|
||||
"version": "1.6.2",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.6.2.tgz",
|
||||
"integrity": "sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==",
|
||||
"version": "1.6.5",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.6.5.tgz",
|
||||
"integrity": "sha512-Ii012v05KEVuUoFWmMW/UQv9aRIc3ZwkWDcM+h5Il8izZCtRVpDUfwpoFf7eOtajT3QiGR4yDUx7lPqHJULgbg==",
|
||||
"dependencies": {
|
||||
"follow-redirects": "^1.15.0",
|
||||
"follow-redirects": "^1.15.4",
|
||||
"form-data": "^4.0.0",
|
||||
"proxy-from-env": "^1.1.0"
|
||||
}
|
||||
@@ -416,7 +416,7 @@
|
||||
"readable-stream": "^3.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/bl/node_modules/buffer": {
|
||||
"node_modules/buffer": {
|
||||
"version": "5.7.1",
|
||||
"resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz",
|
||||
"integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==",
|
||||
@@ -439,42 +439,6 @@
|
||||
"ieee754": "^1.1.13"
|
||||
}
|
||||
},
|
||||
"node_modules/bl/node_modules/readable-stream": {
|
||||
"version": "3.6.2",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
|
||||
"integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
|
||||
"dependencies": {
|
||||
"inherits": "^2.0.3",
|
||||
"string_decoder": "^1.1.1",
|
||||
"util-deprecate": "^1.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/buffer": {
|
||||
"version": "6.0.3",
|
||||
"resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz",
|
||||
"integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/feross"
|
||||
},
|
||||
{
|
||||
"type": "patreon",
|
||||
"url": "https://www.patreon.com/feross"
|
||||
},
|
||||
{
|
||||
"type": "consulting",
|
||||
"url": "https://feross.org/support"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"base64-js": "^1.3.1",
|
||||
"ieee754": "^1.2.1"
|
||||
}
|
||||
},
|
||||
"node_modules/buffer-equal": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-1.0.1.tgz",
|
||||
@@ -713,56 +677,32 @@
|
||||
}
|
||||
},
|
||||
"node_modules/docker-modem": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/docker-modem/-/docker-modem-5.0.1.tgz",
|
||||
"integrity": "sha512-vqrE/nrweCyzmCpVpdFRC41qS+tfTF+IoUKlTZr52O82urbUqdfyJBGWMvT01pYUprWepLr8IkyVTEWJKRTQSg==",
|
||||
"version": "5.0.3",
|
||||
"resolved": "https://registry.npmjs.org/docker-modem/-/docker-modem-5.0.3.tgz",
|
||||
"integrity": "sha512-89zhop5YVhcPEt5FpUFGr3cDyceGhq/F9J+ZndQ4KfqNvfbJpPMfgeixFgUj5OjCYAboElqODxY5Z1EBsSa6sg==",
|
||||
"dependencies": {
|
||||
"debug": "^4.1.1",
|
||||
"readable-stream": "^3.5.0",
|
||||
"split-ca": "^1.0.1",
|
||||
"ssh2": "^1.11.0"
|
||||
"ssh2": "^1.15.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/docker-modem/node_modules/readable-stream": {
|
||||
"version": "3.6.2",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
|
||||
"integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
|
||||
"dependencies": {
|
||||
"inherits": "^2.0.3",
|
||||
"string_decoder": "^1.1.1",
|
||||
"util-deprecate": "^1.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/dockerode": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/dockerode/-/dockerode-4.0.0.tgz",
|
||||
"integrity": "sha512-3LF7/3MPz5+9RsUo91rD0MCcx0yxjC9bnbtgtVjOLKyKxlZSJ7/Kk3OPAgARlwlWHqXwAGYhmkAHYx7IwD0tJQ==",
|
||||
"version": "4.0.2",
|
||||
"resolved": "https://registry.npmjs.org/dockerode/-/dockerode-4.0.2.tgz",
|
||||
"integrity": "sha512-9wM1BVpVMFr2Pw3eJNXrYYt6DT9k0xMcsSCjtPvyQ+xa1iPg/Mo3T/gUcwI0B2cczqCeCYRPF8yFYDwtFXT0+w==",
|
||||
"dependencies": {
|
||||
"@balena/dockerignore": "^1.0.2",
|
||||
"docker-modem": "^5.0.0",
|
||||
"docker-modem": "^5.0.3",
|
||||
"tar-fs": "~2.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/dockerode/node_modules/tar-fs": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.0.1.tgz",
|
||||
"integrity": "sha512-6tzWDMeroL87uF/+lin46k+Q+46rAJ0SyPGz7OW7wTgblI273hsBqk2C1j0/xNadNLKDTUL9BukSjB7cwgmlPA==",
|
||||
"dependencies": {
|
||||
"chownr": "^1.1.1",
|
||||
"mkdirp-classic": "^0.5.2",
|
||||
"pump": "^3.0.0",
|
||||
"tar-stream": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/dotenv": {
|
||||
"version": "16.3.1",
|
||||
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.3.1.tgz",
|
||||
@@ -840,9 +780,9 @@
|
||||
"integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw=="
|
||||
},
|
||||
"node_modules/follow-redirects": {
|
||||
"version": "1.15.3",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz",
|
||||
"integrity": "sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==",
|
||||
"version": "1.15.4",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.4.tgz",
|
||||
"integrity": "sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "individual",
|
||||
@@ -916,9 +856,9 @@
|
||||
]
|
||||
},
|
||||
"node_modules/infobox-parser": {
|
||||
"version": "3.6.2",
|
||||
"resolved": "https://registry.npmjs.org/infobox-parser/-/infobox-parser-3.6.2.tgz",
|
||||
"integrity": "sha512-lasdwvbtjCtDDO6mArAs/ueFEnBJRyo2UbZPAkd5rEG5NVJ3XFCOvbMwNTT/rJlFv1+ORw8D3UvZV4brpgATCg==",
|
||||
"version": "3.6.4",
|
||||
"resolved": "https://registry.npmjs.org/infobox-parser/-/infobox-parser-3.6.4.tgz",
|
||||
"integrity": "sha512-d2lTlxKZX7WsYxk9/UPt51nkmZv5tbC75SSw4hfHqZ3LpRAn6ug0oru9xI2X+S78va3aUAze3xl/UqMuwLmJUw==",
|
||||
"dependencies": {
|
||||
"camelcase": "^4.1.0"
|
||||
},
|
||||
@@ -1184,9 +1124,9 @@
|
||||
"integrity": "sha512-vGBKTA+jwM4KgjGZ+S/8/Mkj9rWzePyGY6jManXPGhiWu63RYwW8dKPyk5koP+8qNVhPhHgFa1y/MJ4wrjsNrg=="
|
||||
},
|
||||
"node_modules/magic-bytes.js": {
|
||||
"version": "1.6.0",
|
||||
"resolved": "https://registry.npmjs.org/magic-bytes.js/-/magic-bytes.js-1.6.0.tgz",
|
||||
"integrity": "sha512-eOGBE+NSCwU9dKKox93BPHjX4KSxIuiRY1/H1lkfxIagT0Llhs6bkRk8iqoP/0aeDl7FEZPa+ln5lay5mcNY4w=="
|
||||
"version": "1.7.0",
|
||||
"resolved": "https://registry.npmjs.org/magic-bytes.js/-/magic-bytes.js-1.7.0.tgz",
|
||||
"integrity": "sha512-YzVU2+/hrjwx8xcgAw+ffNq3jkactpj+f1iSL4LonrFKhvnwDzHSqtFdk/MMRP53y9ScouJ7cKEnqYsJwsHoYA=="
|
||||
},
|
||||
"node_modules/midi-file": {
|
||||
"version": "1.2.4",
|
||||
@@ -1224,9 +1164,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/minecraft-data": {
|
||||
"version": "3.53.0",
|
||||
"resolved": "https://registry.npmjs.org/minecraft-data/-/minecraft-data-3.53.0.tgz",
|
||||
"integrity": "sha512-35+XuLCgzG0xvXKaN2huF5EpUXjjW7HE6fRg1bz4lwI+7sjl4DDQRnRTvdJq3gGrNT8lkWvtBf71/NnXvhdh+Q=="
|
||||
"version": "3.59.3",
|
||||
"resolved": "https://registry.npmjs.org/minecraft-data/-/minecraft-data-3.59.3.tgz",
|
||||
"integrity": "sha512-aepxh0sSe7BmMx61kXhRkoG3FJ2fGBdIR27pBuDmuSia8HZvuCb/kIygkU0bkeLP8MBGYmH97WNdJIGPZD+Xow=="
|
||||
},
|
||||
"node_modules/minecraft-folder-path": {
|
||||
"version": "1.2.0",
|
||||
@@ -1311,10 +1251,48 @@
|
||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
|
||||
"integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ=="
|
||||
},
|
||||
"node_modules/minecraft-protocol/node_modules/buffer": {
|
||||
"version": "6.0.3",
|
||||
"resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz",
|
||||
"integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/feross"
|
||||
},
|
||||
{
|
||||
"type": "patreon",
|
||||
"url": "https://www.patreon.com/feross"
|
||||
},
|
||||
{
|
||||
"type": "consulting",
|
||||
"url": "https://feross.org/support"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"base64-js": "^1.3.1",
|
||||
"ieee754": "^1.2.1"
|
||||
}
|
||||
},
|
||||
"node_modules/minecraft-protocol/node_modules/readable-stream": {
|
||||
"version": "4.5.2",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz",
|
||||
"integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==",
|
||||
"dependencies": {
|
||||
"abort-controller": "^3.0.0",
|
||||
"buffer": "^6.0.3",
|
||||
"events": "^3.3.0",
|
||||
"process": "^0.11.10",
|
||||
"string_decoder": "^1.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/mineflayer": {
|
||||
"version": "4.14.0",
|
||||
"resolved": "https://registry.npmjs.org/mineflayer/-/mineflayer-4.14.0.tgz",
|
||||
"integrity": "sha512-4EYzUmZNxH3Gpz3GkgO2eaR90ANb50nVhMCU2y6Rl1Ru8M6HqxID1Eg7tRgsodfAOD+AKh5SPwmPnISLcxvnOA==",
|
||||
"version": "4.17.0",
|
||||
"resolved": "https://registry.npmjs.org/mineflayer/-/mineflayer-4.17.0.tgz",
|
||||
"integrity": "sha512-Bu5vwv3rhVjyMV8jtR/i+2SmJHXPdfUAIHQ2JBCwY/w+dpjsIu+gW97l+zBz365HraRO0i+kKb3xxSluAHp7hQ==",
|
||||
"dependencies": {
|
||||
"minecraft-data": "^3.44.0",
|
||||
"minecraft-protocol": "^1.44.0",
|
||||
@@ -1414,17 +1392,17 @@
|
||||
}
|
||||
},
|
||||
"node_modules/moment": {
|
||||
"version": "2.29.4",
|
||||
"resolved": "https://registry.npmjs.org/moment/-/moment-2.29.4.tgz",
|
||||
"integrity": "sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==",
|
||||
"version": "2.30.1",
|
||||
"resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz",
|
||||
"integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==",
|
||||
"engines": {
|
||||
"node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/moment-timezone": {
|
||||
"version": "0.5.43",
|
||||
"resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.43.tgz",
|
||||
"integrity": "sha512-72j3aNyuIsDxdF1i7CEgV2FfxM1r6aaqJyLB2vwb33mXYyoyLly+F1zbWqhA3/bVIoJ4szlUoMbUnVdid32NUQ==",
|
||||
"version": "0.5.44",
|
||||
"resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.44.tgz",
|
||||
"integrity": "sha512-nv3YpzI/8lkQn0U6RkLd+f0W/zy/JnoR5/EyPz/dNkPTBjA2jNLCVxaiQ8QpeLymhSZvX0wCL5s27NQWdOPwAw==",
|
||||
"dependencies": {
|
||||
"moment": "^2.29.4"
|
||||
},
|
||||
@@ -1475,9 +1453,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/node-abi": {
|
||||
"version": "3.52.0",
|
||||
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.52.0.tgz",
|
||||
"integrity": "sha512-JJ98b02z16ILv7859irtXn4oUaFWADtvkzy2c0IAatNVX2Mc9Yoh8z6hZInn3QwvMEYhHuQloYi+TTQy67SIdQ==",
|
||||
"version": "3.54.0",
|
||||
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.54.0.tgz",
|
||||
"integrity": "sha512-p7eGEiQil0YUV3ItH4/tBb781L5impVmmx2E9FRKF7d18XXzp4PGT2tdYMFY6wQqgxD0IwNZOiSJ0/K0fSi/OA==",
|
||||
"dependencies": {
|
||||
"semver": "^7.3.5"
|
||||
},
|
||||
@@ -4448,9 +4426,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/prismarine-auth": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/prismarine-auth/-/prismarine-auth-2.3.0.tgz",
|
||||
"integrity": "sha512-giKZiHwuQdpMJ7KX94UncOJqM3u+yqKIR2UI/rqmdmFUuQilV9vhlz/zehpVkvo7FE8gmZsuUMCUPhI+gtgd3A==",
|
||||
"version": "2.4.0",
|
||||
"resolved": "https://registry.npmjs.org/prismarine-auth/-/prismarine-auth-2.4.0.tgz",
|
||||
"integrity": "sha512-4tUtvfvVlymRG/KNCm7E8XZWqbmDme6BrfHDmuC11bXQJKZmfkvyrRcblXuq/Vv87jdhD3HokgWZZcjriZTP0w==",
|
||||
"dependencies": {
|
||||
"@azure/msal-node": "^2.0.2",
|
||||
"@xboxreplay/xboxlive-auth": "^3.3.3",
|
||||
@@ -4513,9 +4491,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/prismarine-entity": {
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/prismarine-entity/-/prismarine-entity-2.3.1.tgz",
|
||||
"integrity": "sha512-HOv8l7IetHNf4hwZ7V/W4vM3GNl+e6VCtKDkH9h02TRq7jWngsggKtJV+VanCce/sNwtJUhJDjORGs728ep4MA==",
|
||||
"version": "2.4.0",
|
||||
"resolved": "https://registry.npmjs.org/prismarine-entity/-/prismarine-entity-2.4.0.tgz",
|
||||
"integrity": "sha512-DBwjmoCX1IYAhN99KwYkk2rMArn65JHTzuuGXchr4GLWQs7UN4Pf9tELqBwNOu4r57x3RaW0+9+0sI3FvJQWzQ==",
|
||||
"dependencies": {
|
||||
"prismarine-chat": "^1.4.1",
|
||||
"prismarine-item": "^1.11.2",
|
||||
@@ -4638,19 +4616,6 @@
|
||||
"protodef-validator": "cli.js"
|
||||
}
|
||||
},
|
||||
"node_modules/protodef/node_modules/readable-stream": {
|
||||
"version": "3.6.2",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
|
||||
"integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
|
||||
"dependencies": {
|
||||
"inherits": "^2.0.3",
|
||||
"string_decoder": "^1.1.1",
|
||||
"util-deprecate": "^1.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/proxy-from-env": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
|
||||
@@ -4729,18 +4694,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/readable-stream": {
|
||||
"version": "4.4.2",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.4.2.tgz",
|
||||
"integrity": "sha512-Lk/fICSyIhodxy1IDK2HazkeGjSmezAWX2egdtJnYhtzKEsBPJowlI6F6LPb5tqIQILrMbx22S5o3GuJavPusA==",
|
||||
"version": "3.6.2",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
|
||||
"integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
|
||||
"dependencies": {
|
||||
"abort-controller": "^3.0.0",
|
||||
"buffer": "^6.0.3",
|
||||
"events": "^3.3.0",
|
||||
"process": "^0.11.10",
|
||||
"string_decoder": "^1.3.0"
|
||||
"inherits": "^2.0.3",
|
||||
"string_decoder": "^1.1.1",
|
||||
"util-deprecate": "^1.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/readline": {
|
||||
@@ -4902,9 +4865,9 @@
|
||||
"integrity": "sha512-Q5thBSxp5t8WPTTJQS59LrGqOZqOsrhDGDVm8azCqIBjSBd7nd9o2PM+mDulQQkh8h//4U6hFZnc/mul8t5pWQ=="
|
||||
},
|
||||
"node_modules/ssh2": {
|
||||
"version": "1.14.0",
|
||||
"resolved": "https://registry.npmjs.org/ssh2/-/ssh2-1.14.0.tgz",
|
||||
"integrity": "sha512-AqzD1UCqit8tbOKoj6ztDDi1ffJZ2rV2SwlgrVVrHPkV5vWqGJOVp5pmtj18PunkPJAuKQsnInyKV+/Nb2bUnA==",
|
||||
"version": "1.15.0",
|
||||
"resolved": "https://registry.npmjs.org/ssh2/-/ssh2-1.15.0.tgz",
|
||||
"integrity": "sha512-C0PHgX4h6lBxYx7hcXwu3QWdh4tg6tZZsTfXcdvc5caW/EMxaB4H9dWsl7qk+F7LAW762hp8VbXOX7x4xUYvEw==",
|
||||
"hasInstallScript": true,
|
||||
"dependencies": {
|
||||
"asn1": "^0.2.6",
|
||||
@@ -4914,8 +4877,8 @@
|
||||
"node": ">=10.16.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"cpu-features": "~0.0.8",
|
||||
"nan": "^2.17.0"
|
||||
"cpu-features": "~0.0.9",
|
||||
"nan": "^2.18.0"
|
||||
}
|
||||
},
|
||||
"node_modules/ssh2/node_modules/asn1": {
|
||||
@@ -4935,9 +4898,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/streamx": {
|
||||
"version": "2.15.5",
|
||||
"resolved": "https://registry.npmjs.org/streamx/-/streamx-2.15.5.tgz",
|
||||
"integrity": "sha512-9thPGMkKC2GctCzyCUjME3yR03x2xNo0GPKGkRw2UMYN+gqWa9uqpyNWhmsNCutU5zHmkUum0LsCRQTXUgUCAg==",
|
||||
"version": "2.15.6",
|
||||
"resolved": "https://registry.npmjs.org/streamx/-/streamx-2.15.6.tgz",
|
||||
"integrity": "sha512-q+vQL4AAz+FdfT137VF69Cc/APqUbxy+MDOImRrMvchJpigHj9GksgDU2LYbO9rx7RX6osWgxJB2WxhYv4SZAw==",
|
||||
"dependencies": {
|
||||
"fast-fifo": "^1.1.0",
|
||||
"queue-tick": "^1.0.1"
|
||||
@@ -5003,14 +4966,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/tar-fs": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz",
|
||||
"integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==",
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.0.1.tgz",
|
||||
"integrity": "sha512-6tzWDMeroL87uF/+lin46k+Q+46rAJ0SyPGz7OW7wTgblI273hsBqk2C1j0/xNadNLKDTUL9BukSjB7cwgmlPA==",
|
||||
"dependencies": {
|
||||
"chownr": "^1.1.1",
|
||||
"mkdirp-classic": "^0.5.2",
|
||||
"pump": "^3.0.0",
|
||||
"tar-stream": "^2.1.4"
|
||||
"tar-stream": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/tar-stream": {
|
||||
@@ -5028,19 +4991,6 @@
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/tar-stream/node_modules/readable-stream": {
|
||||
"version": "3.6.2",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
|
||||
"integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
|
||||
"dependencies": {
|
||||
"inherits": "^2.0.3",
|
||||
"string_decoder": "^1.1.1",
|
||||
"util-deprecate": "^1.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/toidentifier": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
|
||||
@@ -5108,8 +5058,8 @@
|
||||
},
|
||||
"node_modules/urban-dictionary": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/urban-dictionary/-/urban-dictionary-3.0.2.tgz",
|
||||
"integrity": "sha512-hoYevSg6JNr8NiYRtxz7sqBDBu4RL52Bd45L2jQQ44Rwrz6ACmnKnRcUkH2TIQRILN+viZMT/MYYU3OyBz68AA==",
|
||||
"resolved": "git+https://code.chipmunk.land/ChipmunkMC/urban-dictionary.git#3b60e3adce74d62f660b2b22a16c5a0084250757",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=14.15.1"
|
||||
}
|
||||
@@ -5169,9 +5119,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/vec3": {
|
||||
"version": "0.1.8",
|
||||
"resolved": "https://registry.npmjs.org/vec3/-/vec3-0.1.8.tgz",
|
||||
"integrity": "sha512-LfKrP625Bsg/Tj52YdYPsHmpsJuo+tc6fLxZxXjEo9k2xSspKlPvoYTHehykKhp1FvV9nm+XU3Ehej5/9tpDCg=="
|
||||
"version": "0.1.10",
|
||||
"resolved": "https://registry.npmjs.org/vec3/-/vec3-0.1.10.tgz",
|
||||
"integrity": "sha512-Sr1U3mYtMqCOonGd3LAN9iqy0qF6C+Gjil92awyK/i2OwiUo9bm7PnLgFpafymun50mOjnDcg4ToTgRssrlTcw=="
|
||||
},
|
||||
"node_modules/vm2": {
|
||||
"version": "3.9.19",
|
||||
|
||||
+3
-2
@@ -10,12 +10,13 @@
|
||||
"dockerode": "^4.0.0",
|
||||
"dotenv": "^16.3.1",
|
||||
"isolated-vm": "^4.6.0",
|
||||
"minecraft-data": "^3.53.0",
|
||||
"minecraft-data": "^3.59.3",
|
||||
"minecraft-protocol": "^1.45.0",
|
||||
"minecraft-protocol-forge": "^1.0.0",
|
||||
"mineflayer": "^4.14.0",
|
||||
"mineflayer-cmd": "^1.1.3",
|
||||
"moment-timezone": "^0.5.43",
|
||||
"node-fetch": "^2.7.0",
|
||||
"npm": "^9.5.1",
|
||||
"prismarine-chat": "^1.9.1",
|
||||
"prismarine-nbt": "^2.2.1",
|
||||
@@ -24,7 +25,7 @@
|
||||
"randomstring": "^1.3.0",
|
||||
"readline": "^1.3.0",
|
||||
"sharp": "^0.32.6",
|
||||
"urban-dictionary": "^3.0.2",
|
||||
"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",
|
||||
|
||||
+7
-7
@@ -3,18 +3,18 @@ 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');
|
||||
const logFileName = `${timestamp}.log`;
|
||||
const logFolder = path.join(__dirname, '../logs');
|
||||
const logFileName = `${timestamp}.txt`;
|
||||
const logFilePath = path.join(logFolder, logFileName);
|
||||
const logStream = fs.createWriteStream(logFilePath, { flags: 'a' });
|
||||
|
||||
function log (message, toFile = true, toConsole = true) {
|
||||
function log (message, bot, toFile = true, toConsole = true ) {
|
||||
const now = new Date().toLocaleString();
|
||||
|
||||
const toWrite = `[${now}] ${message}`
|
||||
|
||||
if (bot.options.filelogging = true) {
|
||||
const toWrite = `${message}`
|
||||
}
|
||||
if (toFile) logStream.write(toWrite + '\n');
|
||||
if (toConsole) console.log(toWrite);
|
||||
//if (toConsole) console.log(toWrite);
|
||||
};
|
||||
|
||||
if (!fs.existsSync(logFolder)) {
|
||||
|
||||
Reference in New Issue
Block a user